adding new GNUNET_HELPER_ API for communication with (SUID) helper binaries via stdin...
[oweals/gnunet.git] / src / util / os_network.c
index b25e9d00b26132c04fef8d1add7501a966084609..7449f80686872b9f96b49fa3d8b067ca7ead3084 100644 (file)
@@ -61,9 +61,9 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
     if (GNUNET_OK !=
         proc (proc_cls, results[i].pretty_name, results[i].is_default,
               &results[i].address,
-              results[i].flags & ENUMNICS3_MASK_OK ? &results[i].mask : NULL,
               results[i].
               flags & ENUMNICS3_BCAST_OK ? &results[i].broadcast : NULL,
+              results[i].flags & ENUMNICS3_MASK_OK ? &results[i].mask : NULL,
               results[i].addr_size))
       break;
   }
@@ -105,6 +105,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
   const char *start;
   char ifc[12];
   char addrstr[128];
+  char bcstr[128];
   FILE *f;
   int have_ifc;
   struct sockaddr_in a4;
@@ -149,7 +150,7 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
     while (('\0' != *start) && (isspace (*start)))
       start++;
     if (                        /* Linux */
-         (1 == SSCANF (start, "inet addr:%127s", addrstr)) ||
+       (2 == SSCANF (start, "inet addr:%127s Bcast:%127s", addrstr, bcstr)) ||
          (1 == SSCANF (start, "inet6 addr:%127s", addrstr)) ||
          /* Solaris, OS X */
          (1 == SSCANF (start, "inet %127s", addrstr)) ||