Fix the build WITH_DNS_UPDATES.
authorGünther Deschner <gd@samba.org>
Fri, 12 Oct 2007 09:37:03 +0000 (11:37 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 12 Oct 2007 09:37:03 +0000 (11:37 +0200)
Jeremy, please have a look.

Guenther
(This used to be commit 4dfda879a3ad44be7008702b9fbefe3858436118)

source3/utils/net_dns.c

index 716192b057097b23f733c36448888656c3858ed1..8b82a96892d12cb3776ec3e10dc6e14c714d592e 100644 (file)
@@ -157,8 +157,14 @@ int get_my_ip_address( struct in_addr **ips )
        }
 
        for ( i=0; i<n; i++ ) {
-               if (!is_loopback_ip_v4(nics[i].iface_addr.ip.s_addr)) {
-                       memcpy( &list[count++], &nics[i].iface_addr.ip, sizeof( struct in_addr ) );
+               if ((nics[i].ip.ss_family == AF_INET)) {
+                       struct in_addr ifip;
+
+                       ifip = ((const struct sockaddr_in *)&nics[i].ip)->sin_addr;
+
+                       if (!is_loopback_ip_v4(ifip)) {
+                               memcpy(&list[count++], &ifip, sizeof(struct in_addr));
+                       }
                }
        }
        *ips = list;