Not all implementations of struct ifaddrs define ifa_broadaddr.
authorMichael Adam <obnox@samba.org>
Fri, 22 Feb 2008 09:43:42 +0000 (10:43 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 22 Feb 2008 09:43:42 +0000 (10:43 +0100)
E.g. the definition of libreplace doesn't. :-o

Michael

source/lib/interfaces.c

index 8925958e95f639d885512662cb7c291189cfe0f2..dd857ae6722f31bc62de29318e7d8503ef6ea05c 100644 (file)
@@ -236,19 +236,9 @@ static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces)
                memcpy(&ifaces[total].netmask, ifptr->ifa_netmask, copy_size);
 
                if (ifaces[total].flags & (IFF_BROADCAST|IFF_LOOPBACK)) {
-                       if (ifptr->ifa_broadaddr) {
-                               memcpy(&ifaces[total].bcast,
-                                       ifptr->ifa_broadaddr,
-                                       copy_size);
-                       } else {
-                               /* For some reason ifptr->ifa_broadaddr
-                                * is null. Make one from ifa_addr and
-                                * ifa_netmask.
-                                */
-                               make_bcast(&ifaces[total].bcast,
-                                       &ifaces[total].ip,
-                                       &ifaces[total].netmask);
-                       }
+                       make_bcast(&ifaces[total].bcast,
+                               &ifaces[total].ip,
+                               &ifaces[total].netmask);
                } else if ((ifaces[total].flags & IFF_POINTOPOINT) &&
                               ifptr->ifa_dstaddr ) {
                        memcpy(&ifaces[total].bcast,