Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.19 /Documentation/networking/ifenslave.c

Filename:/Documentation/networking/ifenslave.c
Lines Added:12
Lines Deleted:9
Also changed in: (Previous) 2.4.19-rc5  2.4.19-rc4  2.4.19-rc3  2.4.19-rc2  2.4.19-rc1  2.4.19-pre10 
(Following) 2.4.21-pre3  2.4.21-pre4  2.4.21-pre5  2.4.21-pre6  2.4.21-pre7  2.4.21-rc1 

Location
[  2.4.19
  [  Documentation
    [  networking
       o  ifenslave.c

Patch

diff -urN linux-2.4.18/Documentation/networking/ifenslave.c linux-2.4.19/Documentation/networking/ifenslave.c
--- linux-2.4.18/Documentation/networking/ifenslave.c   Wed Nov  7 14:39:36 2001
+++ linux-2.4.19/Documentation/networking/ifenslave.c   Fri Aug  2 17:39:42 2002
@@ -38,6 +38,9 @@
  *         take care of this itself
  *       - Try the SIOC*** versions of the bonding ioctls before using the
  *         old versions
+ *    - 2002/02/18 Erik Habbinga <erik_habbinga @ hp dot com> :
+ *       - ifr2.ifr_flags was not initialized in the hwaddr_notset case,
+ *         SIOCGIFFLAGS now called before hwaddr_notset test
  */
 
 static char *version =
@@ -288,19 +291,19 @@
               hwaddr from it's first slave.
             - if !hwaddr_notset, assign the master's hwaddr to each slave
          */
-   
+
+         strncpy(ifr2.ifr_name, slave_ifname, IFNAMSIZ);
+         if (ioctl(skfd, SIOCGIFFLAGS, &ifr2) < 0) {
+            int saved_errno = errno;
+            fprintf(stderr, "SIOCGIFFLAGS on %s failed: %s\n", slave_ifname,
+                  strerror(saved_errno));
+            return 1;
+         }
+
          if (hwaddr_notset) { /* we do nothing */
 
          }
          else {  /* we'll assign master's hwaddr to this slave */
-            strncpy(ifr2.ifr_name, slave_ifname, IFNAMSIZ);
-            if (ioctl(skfd, SIOCGIFFLAGS, &ifr2) < 0) {
-               int saved_errno = errno;
-               fprintf(stderr, "SIOCGIFFLAGS on %s failed: %s\n", slave_ifname,
-                     strerror(saved_errno));
-               return 1;
-            }
-   
             if (ifr2.ifr_flags & IFF_UP) {
                ifr2.ifr_flags &= ~IFF_UP;
                if (ioctl(skfd, SIOCSIFFLAGS, &ifr2) < 0) {


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.