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

Bug#771426: unblock: ifupdown/0.7.50



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

Please unblock package ifupdown

This upload is going to fix some bugs I consider important for
ifupdown in Jessie:

#766943: integration with systemd

  Commit: http://anonscm.debian.org/hg/collab-maint/ifupdown/rev/5ce912bba350

#709378: implicit loopback interface which doesn't break explicit declarations

  Commit: http://anonscm.debian.org/hg/collab-maint/ifupdown/rev/6cd0fd2addca

#741579: correct udhcpc command-line options

  Commit: http://anonscm.debian.org/hg/collab-maint/ifupdown/rev/57543880a251

Also, there are some minor changes:

  Some compiler warning fixed: http://anonscm.debian.org/hg/collab-maint/ifupdown/rev/0073288aafed
  Manpage updated: http://anonscm.debian.org/hg/collab-maint/ifupdown/rev/677fac592fcb

I've also had one change staged which is a simplification of the
Makefile by using mk-configure, but I'm not sure if it's appropriate at
this moment, so I'm not including it into the debdiff, but please
comment if you think it might be okay:

http://anonscm.debian.org/hg/collab-maint/ifupdown/rev/5ccdd24f6662

Thanks.

unblock ifupdown/0.7.50

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

Kernel: Linux 3.12-1-686-pae (SMP w/4 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/mksh
diff -Nru ifupdown-0.7.49/archlinux.c ifupdown-0.7.50/archlinux.c
--- ifupdown-0.7.49/archlinux.c	2013-07-02 11:44:55.000000000 +0200
+++ ifupdown-0.7.50/archlinux.c	2014-10-04 13:50:46.000000000 +0200
@@ -7,7 +7,7 @@
 
 #include "archlinux.h"
 
-unsigned int mylinuxver()
+unsigned int mylinuxver(void)
 {
     static int maj = -1, rev = 0, min = 0;
 
diff -Nru ifupdown-0.7.49/archlinux.h ifupdown-0.7.50/archlinux.h
--- ifupdown-0.7.49/archlinux.h	2013-07-02 11:44:55.000000000 +0200
+++ ifupdown-0.7.50/archlinux.h	2014-10-04 13:50:46.000000000 +0200
@@ -1,4 +1,4 @@
-unsigned int mylinuxver();
+unsigned int mylinuxver(void);
 unsigned int mylinux(int, int, int);
 #include "header.h"
 
diff -Nru ifupdown-0.7.49/config.c ifupdown-0.7.50/config.c
--- ifupdown-0.7.49/config.c	2013-08-11 09:08:15.000000000 +0200
+++ ifupdown-0.7.50/config.c	2014-11-29 13:53:44.000000000 +0100
@@ -130,6 +130,12 @@
     defn->ifaces = NULL;
 
     if (!no_loopback) {
+        add_allow_up(__FILE__, __LINE__, get_allowup(&defn->allowups, "auto"), LO_IFACE);
+    }
+
+    defn = read_interfaces_defn(defn, filename);
+
+    if (!no_loopback) {
         interface_defn *lo_if = malloc(sizeof(interface_defn));
         if (!lo_if) {
 
@@ -144,14 +150,12 @@
             .method = get_method(&addr_inet, "loopback"),
             .n_options = 0,
             .option = NULL,
-            .next = NULL
+            .next = defn->ifaces
         };
 
         defn->ifaces = lo_if;
-
-        add_allow_up(__FILE__, __LINE__, get_allowup(&defn->allowups, "auto"), lo_if->logical_iface);
     }
-    return read_interfaces_defn(defn, filename);
+    return defn;
 }
 
 static int directory_filter(const struct dirent * d)
@@ -403,6 +407,11 @@
                     fprintf(stderr, "%s:%d: unknown method\n", filename, line);
                     return NULL;        /* FIXME */
                 }
+                if (((!strcmp(address_family_name, "inet")) ||
+                     (!strcmp(address_family_name, "inet6"))) &&
+                     (!strcmp(method_name, "loopback"))) {
+                     no_loopback = 1;
+                }
                 currif->automatic = 1;
                 currif->max_options = 0;
                 currif->n_options = 0;
diff -Nru ifupdown-0.7.49/debian/changelog ifupdown-0.7.50/debian/changelog
--- ifupdown-0.7.49/debian/changelog	2014-09-23 17:39:52.000000000 +0200
+++ ifupdown-0.7.50/debian/changelog	2014-11-29 14:32:55.000000000 +0100
@@ -1,3 +1,18 @@
+ifupdown (0.7.50) unstable; urgency=medium
+
+  [ Andrew Shadura ]
+  * Configure the loopback interface by default only if user hasn't
+    defined their own loopback interface (Closes: #709378).
+  * Update udhcp command-line options (Closes: #741579).
+  * Fix compiler warnings.
+  * Update the documentation regarding "source" keyword.
+
+  [ Michael Biebl ]
+  * Call "udev settle" explicitly before configuring any devices (Closes:
+    #766943).
+
+ -- Andrew Shadura <andrewsh@debian.org>  Sat, 29 Nov 2014 14:32:32 +0100
+
 ifupdown (0.7.49) unstable; urgency=medium
 
   [ Andrew Shadura ]
diff -Nru ifupdown-0.7.49/debian/networking.init ifupdown-0.7.50/debian/networking.init
--- ifupdown-0.7.49/debian/networking.init	2014-09-23 17:35:33.000000000 +0200
+++ ifupdown-0.7.50/debian/networking.init	2014-11-29 14:08:42.000000000 +0100
@@ -105,7 +105,7 @@
 			    do
 				    link=${iface##:*}
 				    link=${link##.*}
-				    if [ -e "/sys/class/net/$link" ] && [ "$(cat /sys/class/net/$link/operstate)" = up ]
+				    if [ -e "/sys/class/net/$link" ]
 				    then
 					    echo "$iface"
 				    fi
@@ -133,7 +133,12 @@
 	set -f
 	exclusions=$(process_exclusions)
 	log_action_begin_msg "Configuring network interfaces"
-	if ifup -a $exclusions $verbose
+	if [ -x /sbin/udevadm ]; then
+		if [ -n "$(ifquery --list --exclude=lo)" ] || [ -n "$(ifquery --list --allow=hotplug)" ]; then
+			udevadm settle || true
+		fi
+	fi
+	if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose
 	then
 	    log_action_end_msg $?
 	else
diff -Nru ifupdown-0.7.49/debian/testbuild-linux ifupdown-0.7.50/debian/testbuild-linux
--- ifupdown-0.7.49/debian/testbuild-linux	2014-03-23 18:26:04.000000000 +0100
+++ ifupdown-0.7.50/debian/testbuild-linux	2014-11-29 14:05:16.000000000 +0100
@@ -519,6 +519,34 @@
 run-parts --exit-on-error --verbose /etc/network/if-up.d
 EOF
 
+cat >tests/testcase.11 <<EOF
+# RUN: -a
+auto lo eth0
+
+iface eth0 inet static
+  address 1.2.3.4/24
+
+iface lo inet loopback
+  pre-up configure lo
+  post-down deconfigure lo
+EOF
+cat >tests/up.11 <<EOF
+====stdout====
+====stderr====
+run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+Configuring interface lo=lo (inet)
+configure lo
+run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+ip link set dev lo up
+run-parts --exit-on-error --verbose /etc/network/if-up.d
+Configuring interface eth0=eth0 (inet)
+run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
+ip addr add 1.2.3.4/255.255.255.0 broadcast 1.2.3.255 	  dev eth0 label eth0
+ip link set dev eth0   up
+
+run-parts --exit-on-error --verbose /etc/network/if-up.d
+run-parts --exit-on-error --verbose /etc/network/if-up.d
+EOF
 
 result=true
 for test in 1 2 3 4 5 6 7 8 9 10; do
@@ -534,6 +562,25 @@
         if diff -ub tests/up.$test tests/up-res.$test; then
                 echo "(okay)"
         else
+                echo "(failed)"
+                result=false
+        fi
+        echo "=========="
+done
+
+for test in 11; do
+        args="$(cat tests/testcase.$test | sed -n 's/^# RUN: //p')"
+        ./ifup -nv --force -i tests/testcase.$test $args \
+                >tests/up-res-out.$test 2>tests/up-res-err.$test || 
+                true
+        (echo "====stdout===="; cat tests/up-res-out.$test
+         echo "====stderr===="; cat tests/up-res-err.$test) > tests/up-res.$test
+
+        echo "Testcase $test: $args"
+
+        if diff -ub tests/up.$test tests/up-res.$test; then
+                echo "(okay)"
+        else
                 echo "(failed)"
                 result=false
         fi
diff -Nru ifupdown-0.7.49/header.h ifupdown-0.7.50/header.h
--- ifupdown-0.7.49/header.h	2014-09-23 17:17:19.000000000 +0200
+++ ifupdown-0.7.50/header.h	2014-10-04 13:50:46.000000000 +0200
@@ -2,6 +2,7 @@
 #define HEADER_H
 
 #include <stdbool.h>
+#include <string.h>
 
 typedef struct address_family address_family;
 typedef struct method method;
diff -Nru ifupdown-0.7.49/inet.defn ifupdown-0.7.50/inet.defn
--- ifupdown-0.7.49/inet.defn	2014-07-07 19:42:05.000000000 +0200
+++ ifupdown-0.7.50/inet.defn	2014-11-29 14:24:14.000000000 +0100
@@ -73,7 +73,7 @@
     leasehours leasehours   -- Preferred lease time in hours (pump)
     leasetime leasetime     -- Preferred lease time in seconds (dhcpcd)
     vendor vendor           -- Vendor class identifier (dhcpcd)
-    client client           -- Client identifier (dhcpcd, udhcpc)
+    client client           -- Client identifier (dhcpcd)
     hwaddress address       -- Hardware address.
 
   conversion
@@ -89,8 +89,7 @@
         elsif (execable("/sbin/dhclient3"))
     pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
         elsif (execable("/sbin/pump") && mylinuxver() >= mylinux(2,1,100))
-    udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
-           [[-c %client%]] \
+    udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \
         elsif (execable("/sbin/udhcpc") && mylinuxver() >= mylinux(2,2,0))
     dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
            [[-l %leasetime%]] %iface% \
diff -Nru ifupdown-0.7.49/interfaces.5.pre ifupdown-0.7.50/interfaces.5.pre
--- ifupdown-0.7.49/interfaces.5.pre	2013-07-25 22:50:09.000000000 +0200
+++ ifupdown-0.7.50/interfaces.5.pre	2014-11-29 13:37:38.000000000 +0100
@@ -29,8 +29,8 @@
 A line may be extended across multiple lines by making the last character
 a backslash.
 .P
-The file consists of zero or more "iface", "mapping", "auto", "allow-" and
-"source" stanzas. Here is an example.
+The file consists of zero or more "iface", "mapping", "auto", "allow-",
+"source" and "source-directory" stanzas. Here is an example.
 .EX
 auto eth0
 allow-hotplug eth1
@@ -93,8 +93,12 @@
 paths to the included files are understood to be under
 .IR /etc/network\fR.
 .P
+Currently, "source-directory" isn't supported by
+.BR network-manager " and"
+.BR guessnet .
+.P
 By default, on a freshly installed Debian system, the interfaces file includes a
-line to source
+line to source files in the
 .IR /etc/network/interfaces.d
 directory.
 .P
diff -Nru ifupdown-0.7.49/main.c ifupdown-0.7.50/main.c
--- ifupdown-0.7.49/main.c	2014-09-23 17:17:19.000000000 +0200
+++ ifupdown-0.7.50/main.c	2014-10-04 13:50:46.000000000 +0200
@@ -101,7 +101,7 @@
     exit(0);
 }
 
-FILE * lock_state(const char * argv0) {
+static FILE * lock_state(const char * argv0) {
     FILE *lock_fp;
     lock_fp = fopen(lockfile, no_act ? "r" : "a+");
     if (lock_fp == NULL) {
@@ -519,7 +519,7 @@
                 if (excludeint == NULL) {
                     char *filename = argv[0];
                     perror(filename);
-                    return NULL;
+                    exit(1);
                 }
                 excludeint[excludeints - 1] = strdup(optarg);
                 break;

Reply to: