summaryrefslogtreecommitdiffstats
path: root/source3/lib/interface.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-02 19:27:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:06 -0500
commit3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941 (patch)
treea39948ec0633b6bed73df92ddc0c94dc4c607f12 /source3/lib/interface.c
parent5c5acae0eee9fb113ac6817eb8a164551a1cb117 (diff)
downloadsamba-3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941.tar.gz
samba-3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941.tar.xz
samba-3fbd1ae54ced2eb889a8fe0a6ea32dfd8175f941.zip
r25472: Fix the interfaces code to detect IPv6 interfaces, using the
new standard getifaddrs() and freeifaddrs() interfaces. Currently we only return IPv4 af_families. Needs fixing for binds to IPv6 but this has to be careful work. Jeremy. (This used to be commit 327875182c9219aeba687e10aaea93546d9a70ea)
Diffstat (limited to 'source3/lib/interface.c')
-rw-r--r--source3/lib/interface.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 29ed15a0c26..c1875839239 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -103,12 +103,12 @@ static void interpret_interface(char *token)
zero_ip(&ip);
zero_ip(&nmask);
-
+
/* first check if it is an interface name */
for (i=0;i<total_probed;i++) {
if (gen_fnmatch(token, probed_ifaces[i].name) == 0) {
- add_interface(probed_ifaces[i].ip,
- probed_ifaces[i].netmask);
+ add_interface(probed_ifaces[i].iface_addr.ip,
+ probed_ifaces[i].iface_netmask.netmask);
added = 1;
}
}
@@ -119,10 +119,11 @@ static void interpret_interface(char *token)
if (!p) {
ip = *interpret_addr2(token);
for (i=0;i<total_probed;i++) {
- if (ip.s_addr == probed_ifaces[i].ip.s_addr &&
- !ip_equal(allones_ip, probed_ifaces[i].netmask)) {
- add_interface(probed_ifaces[i].ip,
- probed_ifaces[i].netmask);
+ if (ip.s_addr == probed_ifaces[i].iface_addr.ip.s_addr &&
+ !ip_equal(allones_ip,
+ probed_ifaces[i].iface_netmask.netmask)) {
+ add_interface(probed_ifaces[i].iface_addr.ip,
+ probed_ifaces[i].iface_netmask.netmask);
return;
}
}
@@ -145,8 +146,8 @@ static void interpret_interface(char *token)
if (ip.s_addr == MKBCADDR(ip.s_addr, nmask.s_addr) ||
ip.s_addr == MKNETADDR(ip.s_addr, nmask.s_addr)) {
for (i=0;i<total_probed;i++) {
- if (same_net(ip, probed_ifaces[i].ip, nmask)) {
- add_interface(probed_ifaces[i].ip, nmask);
+ if (same_net(ip, probed_ifaces[i].iface_addr.ip, nmask)) {
+ add_interface(probed_ifaces[i].iface_addr.ip, nmask);
return;
}
}
@@ -203,11 +204,11 @@ void load_interfaces(void)
for (i=0;i<total_probed;i++) {
if (
#if !defined(__s390__)
- probed_ifaces[i].netmask.s_addr != allones_ip.s_addr &&
+ probed_ifaces[i].iface_netmask.netmask.s_addr != allones_ip.s_addr &&
#endif
- probed_ifaces[i].ip.s_addr != loopback_ip.s_addr) {
- add_interface(probed_ifaces[i].ip,
- probed_ifaces[i].netmask);
+ probed_ifaces[i].iface_addr.ip.s_addr != loopback_ip.s_addr) {
+ add_interface(probed_ifaces[i].iface_addr.ip,
+ probed_ifaces[i].iface_netmask.netmask);
}
}
return;