summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-10-11 18:03:12 -0700
committerJeremy Allison <jra@samba.org>2007-10-11 18:03:12 -0700
commitf4fd12acc873f37d54ede954eb7e48a684a7e9d0 (patch)
tree2ccbfd43924f24d32d05d98d6927e0b85cdc93df /source3/lib
parentcb5436bcc3b55e0c221fb6b3fa3133f149a64384 (diff)
downloadsamba-f4fd12acc873f37d54ede954eb7e48a684a7e9d0.tar.gz
samba-f4fd12acc873f37d54ede954eb7e48a684a7e9d0.tar.bz2
samba-f4fd12acc873f37d54ede954eb7e48a684a7e9d0.zip
Try and fix segfault found by Guenther on Fedora. Fedora
seems to return bogus values for the interface entries on vmnet and tun interfaces. Jeremy. (This used to be commit 12c0b1d82802ccd1b272a8b47ddb7d258e10477c)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/interfaces.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/lib/interfaces.c b/source3/lib/interfaces.c
index c56155c64e..e98ea46282 100644
--- a/source3/lib/interfaces.c
+++ b/source3/lib/interfaces.c
@@ -135,11 +135,14 @@ static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces)
memcpy(&ifaces[total].ip, ifptr->ifa_addr, copy_size);
memcpy(&ifaces[total].netmask, ifptr->ifa_netmask, copy_size);
- if (ifaces[total].flags & IFF_BROADCAST) {
+
+ if ((ifaces[total].flags & IFF_BROADCAST) &&
+ ifptr->ifa_broadaddr) {
memcpy(&ifaces[total].bcast,
ifptr->ifa_broadaddr,
copy_size);
- } else if (ifaces[total].flags & IFF_POINTOPOINT) {
+ } else if ((ifaces[total].flags & IFF_POINTOPOINT) &&
+ ifptr->ifa_dstaddr ) {
memcpy(&ifaces[total].bcast,
ifptr->ifa_dstaddr,
copy_size);