[Pkg-sysvinit-commits] r1090 - in sysvinit/trunk/debian: . patches
pere at alioth.debian.org
pere at alioth.debian.org
Sun Dec 23 15:54:09 UTC 2007
Author: pere
Date: 2007-12-23 15:54:09 +0000 (Sun, 23 Dec 2007)
New Revision: 1090
Added:
sysvinit/trunk/debian/patches/26_last_ipv6.dpatch
Modified:
sysvinit/trunk/debian/changelog
sysvinit/trunk/debian/patches/00list
Log:
* New patch 26_last_ipv6 from Fedora to recognize more IPv6 addresses.
Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog 2007-12-23 15:43:27 UTC (rev 1089)
+++ sysvinit/trunk/debian/changelog 2007-12-23 15:54:09 UTC (rev 1090)
@@ -17,6 +17,7 @@
* Fix minor typo in rc*.d/README files (Closes: #452384).
* Make sure init.d/rc do not complain because the new progress bar
API is unavailable (Closes: #457544).
+ * New patch 26_last_ipv6 from Fedora to recognize more IPv6 addresses.
-- Petter Reinholdtsen <pere at debian.org> Sun, 23 Dec 2007 10:03:48 +0100
Modified: sysvinit/trunk/debian/patches/00list
===================================================================
--- sysvinit/trunk/debian/patches/00list 2007-12-23 15:43:27 UTC (rev 1089)
+++ sysvinit/trunk/debian/patches/00list 2007-12-23 15:54:09 UTC (rev 1090)
@@ -8,6 +8,7 @@
16_doc_runlevel
21_ifdown_kfreebsd
25_last_sanify
+26_last_ipv6
30_strip
31_build_warnings
40_selinux
Added: sysvinit/trunk/debian/patches/26_last_ipv6.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/26_last_ipv6.dpatch (rev 0)
+++ sysvinit/trunk/debian/patches/26_last_ipv6.dpatch 2007-12-23 15:54:09 UTC (rev 1090)
@@ -0,0 +1,41 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 26_last_ipv6.dpatch by Petter Reinholdtsen
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Improve handling of IPv6 addresses. Patch from Fedora.
+
+ at DPATCH@
+diff -Naur sysvinit-2.86/src/last.c sysvinit-2.86-ipv6/src/last.c
+--- sysvinit-2.86/src/last.c 2004-07-30 14:16:26.000000000 +0200
++++ sysvinit-2.86-ipv6/src/last.c 2006-07-19 16:14:24.000000000 +0200
+@@ -307,14 +307,15 @@
+ struct sockaddr *sa;
+ int salen, flags;
+ unsigned int topnibble;
++ unsigned int azero = 0, sitelocal = 0;
+ int mapped = 0;
+
+ flags = useip ? NI_NUMERICHOST : 0;
+
+ /*
+ * IPv4 or IPv6 ? We use 2 heuristics:
+- * 1. Current IPv6 range uses 2000-3fff. Outside of
+- * that is illegal and must be IPv4.
++ * 1. Current IPv6 range uses 2000-3fff or fec0-feff.
++ * Outside of that is illegal and must be IPv4.
+ * 2. If last 3 bytes are 0, must be IPv4
+ * 3. If IPv6 in IPv4, handle as IPv4
+ *
+@@ -323,7 +324,11 @@
+ if (a[0] == 0 && a[1] == 0 && a[2] == htonl (0xffff))
+ mapped = 1;
+ topnibble = ntohl((unsigned int)a[0]) >> 28;
+- if (topnibble < 2 || topnibble > 3 || mapped ||
++
++ azero = ntohl((unsigned int)a[0]) >> 16;
++ sitelocal = (azero >= 0xfec0 && azero <= 0xfeff) ? 1 : 0;
++
++ if (((topnibble < 2 || topnibble > 3) && (!sitelocal)) || mapped ||
+ (a[1] == 0 && a[2] == 0 && a[3] == 0)) {
+ /* IPv4 */
+ sin.sin_family = AF_INET;
More information about the Pkg-sysvinit-commits
mailing list