[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#690660: unblock: ifupdown/0.7.3



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package ifupdown

This release fixes the erroneous behaviour of ifupdown when broadcast
address auto-calculation is enabled on /31 links; now ifupdown follows
RFC 3021 in this regard. Also, the same broadcast auto-calculation
didn't work properly at all if obsolete broadcast addressing scheme was
used, when the broadcast address is generated by setting host address
bits to zeroes, not ones. Some test cases for those bugs are added also.

For details regarding RFC 3021 issue see #690561.

The source package may be downloaded for the review from here:

http://alioth.debian.org/~andrewshadoura-guest/debian/unstable/ifupdown_0.7.3.dsc

Debdiff is also attached. Please also note that the package has not been
uploaded yet.

unblock ifupdown/0.7.3

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.5-trunk-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru ifupdown-0.7.2/debian/changelog ifupdown-0.7.3/debian/changelog
--- ifupdown-0.7.2/debian/changelog	2012-08-16 23:23:03.000000000 +0200
+++ ifupdown-0.7.3/debian/changelog	2012-10-15 23:22:53.000000000 +0200
@@ -1,3 +1,12 @@
+ifupdown (0.7.3) unstable; urgency=low
+
+  * Fix the calculation of broadcast addresses of obsolete scheme;
+    previously, a network mask was mistakenly used instead of them.
+  * Follow RFC 3021 regarding broadcast addresses in /31 subnets:
+    they should use limited broadcast address (Closes: #690561).
+
+ -- Andrew O. Shadura <bugzilla@tut.by>  Mon, 15 Oct 2012 23:19:58 +0200
+
 ifupdown (0.7.2) unstable; urgency=low
 
   * Don't install /etc/default/networking as executable (Closes: #679623).
diff -Nru ifupdown-0.7.2/debian/testbuild-linux ifupdown-0.7.3/debian/testbuild-linux
--- ifupdown-0.7.2/debian/testbuild-linux	2012-08-15 12:17:16.000000000 +0200
+++ ifupdown-0.7.3/debian/testbuild-linux	2012-10-15 23:18:30.000000000 +0200
@@ -4,7 +4,7 @@
 mkdir tests
 cat >tests/testcase.1 <<EOF
 # RUN: -a
-auto eth0 eth1 eth2
+auto eth0 eth1 eth2 eth3
 iface eth0 inet static
   address 1.2.3.4
   netmask 255.255.255.0
@@ -24,6 +24,25 @@
   broadcast 1.2.3.127
   up echo hi
   post-up echo hello
+
+iface eth3 inet static
+  address 1.2.3.4/24
+  broadcast -
+  up true
+
+iface eth3 inet static
+  address 1.2.3.4/30
+  broadcast -
+  up true
+
+iface eth3 inet static
+  address 1.2.3.4/31
+  up true
+
+iface eth3 inet static
+  address 1.2.3.4/31
+  broadcast -
+  up true
 EOF
 cat >tests/up.1 <<EOF
 ====stdout====
@@ -53,6 +72,34 @@
 echo hi
 echo hello
 run-parts --verbose /etc/network/if-up.d
+Configuring interface eth3=eth3 (inet)
+run-parts --verbose /etc/network/if-pre-up.d
+ip addr add 1.2.3.4/255.255.255.0 broadcast 1.2.3.0 	  dev eth3 label eth3
+ip link set dev eth3   up
+
+true
+run-parts --verbose /etc/network/if-up.d
+Configuring interface eth3=eth3 (inet)
+run-parts --verbose /etc/network/if-pre-up.d
+ip addr add 1.2.3.4/255.255.255.252 broadcast 1.2.3.4 	  dev eth3 label eth3
+ip link set dev eth3   up
+
+true
+run-parts --verbose /etc/network/if-up.d
+Configuring interface eth3=eth3 (inet)
+run-parts --verbose /etc/network/if-pre-up.d
+ip addr add 1.2.3.4/255.255.255.254 broadcast 255.255.255.255 	  dev eth3 label eth3
+ip link set dev eth3   up
+
+true
+run-parts --verbose /etc/network/if-up.d
+Configuring interface eth3=eth3 (inet)
+run-parts --verbose /etc/network/if-pre-up.d
+ip addr add 1.2.3.4/255.255.255.254 broadcast 0.0.0.0 	  dev eth3 label eth3
+ip link set dev eth3   up
+
+true
+run-parts --verbose /etc/network/if-up.d
 run-parts --verbose /etc/network/if-up.d
 EOF
 
diff -Nru ifupdown-0.7.2/ifupdown.nw ifupdown-0.7.3/ifupdown.nw
--- ifupdown-0.7.2/ifupdown.nw	2012-08-13 20:20:19.000000000 +0200
+++ ifupdown-0.7.3/ifupdown.nw	2012-10-15 23:17:24.000000000 +0200
@@ -4793,12 +4793,22 @@
 	free(s);
 	if (r != 1) return;
 
-	if (!strcmp(*pparam, "+")) {
-	    addr.s_addr |=  ~mask.s_addr;
-	}
+	if (mask.s_addr != htonl(0xfffffffe)) {
+	    if (!strcmp(*pparam, "+")) {
+		addr.s_addr |= ~mask.s_addr;
+	    }
+
+	    if (!strcmp(*pparam, "-")) {
+		addr.s_addr &= mask.s_addr;
+	    }
+	} else {
+	    if (!strcmp(*pparam, "+")) {
+		addr.s_addr = 0xffffffff;
+	    }
 
-	if (!strcmp(*pparam, "-")) {
-	    addr.s_addr |=  mask.s_addr;
+	    if (!strcmp(*pparam, "-")) {
+		addr.s_addr = 0;
+	    }
 	}
 
 	char buffer[INET_ADDRSTRLEN + 1];

Reply to: