tags 405870 + patch
thanks

On 16/04/08 at 11:06 +0200, Lucas Nussbaum wrote:
> (The above is untested)
> Robert, can you have a look, or do you want me to write a proper patch?
> Or someone else from [EMAIL PROTECTED] (I wouldn't be able to test it on 
> kfreebsd)

Clean patch attached, tested, seems to work.
-- 
| Lucas Nussbaum
| [EMAIL PROTECTED]   http://www.lucas-nussbaum.net/ |
| jabber: [EMAIL PROTECTED]             GPG: 1024D/023B3F4F |
diff -u sysvinit-2.86.ds1/debian/changelog sysvinit-2.86.ds1/debian/changelog
--- sysvinit-2.86.ds1/debian/changelog
+++ sysvinit-2.86.ds1/debian/changelog
@@ -1,3 +1,10 @@
+sysvinit (2.86.ds1-56.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix FreeBSD ifdown patch.
+
+ -- Lucas Nussbaum <[EMAIL PROTECTED]>  Thu, 17 Apr 2008 15:48:38 +0200
+
 sysvinit (2.86.ds1-56) unstable; urgency=low
 
   * Avoid bashism in init.d/rc (Closes: #473694).
diff -u sysvinit-2.86.ds1/debian/patches/21_ifdown_kfreebsd.dpatch sysvinit-2.86.ds1/debian/patches/21_ifdown_kfreebsd.dpatch
--- sysvinit-2.86.ds1/debian/patches/21_ifdown_kfreebsd.dpatch
+++ sysvinit-2.86.ds1/debian/patches/21_ifdown_kfreebsd.dpatch
@@ -5,16 +5,15 @@
 ## DP: Get ifdown working on kFreeBSD. (Closes: #327031)
 
 @DPATCH@
---- sysvinit-2.86.ds1.old/src/ifdown.c	(revisjon 92)
-+++ sysvinit-2.86.ds1/src/ifdown.c	(arbeidskopi)
-@@ -61,10 +61,19 @@
+diff -urNad sysvinit-2.86.ds1~/src/ifdown.c sysvinit-2.86.ds1/src/ifdown.c
+--- sysvinit-2.86.ds1~/src/ifdown.c	2008-04-17 15:49:43.000000000 +0200
++++ sysvinit-2.86.ds1/src/ifdown.c	2008-04-17 15:57:16.000000000 +0200
+@@ -61,10 +61,25 @@
  				continue;
  			if (strchr(ifr[i].ifr_name, ':') != NULL)
  				continue;
 -			ifr[i].ifr_flags &= ~(IFF_UP);
 -			if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) {
--				fprintf(stderr, "ifdown: shutdown ");
--				perror(ifr[i].ifr_name);
 +/* Expected in <net/if.h> according to "UNIX Network Programming". */
 +#ifdef ifr_flags
 +#define FLAGS ifr_flags
@@ -22,6 +21,12 @@
 +/* Present on kFreeBSD, fixes bug #327031. */
 +#define FLAGS ifr_flagshigh
 +#endif
++			/* Read interface flags */
++			if (ioctl(fd, SIOCGIFFLAGS, &ifr[i]) < 0) {
+ 				fprintf(stderr, "ifdown: shutdown ");
+ 				perror(ifr[i].ifr_name);
++				continue;
++			}
 +			if (ifr[i].FLAGS & IFF_UP) {
 +				ifr[i].FLAGS &= ~(IFF_UP);
 +				if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) {

Reply via email to