Linux tuntap devices and other virtual network devices, if not
configured, will be reported by getifaddrs() with a NULL ifa_addr
pointer. __rpc_getifaddrs would trip over that, because it derefenced
the ifa_addr pointer without checking.
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
return 0;
for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) {
- if (ifap->ifa_addr->sa_family != af ||
+ if (ifap->ifa_addr == NULL || /* happens for eg tuntap devices */
+ ifap->ifa_addr->sa_family != af ||
!(ifap->ifa_flags & IFF_UP))
continue;
bip = (struct broadif *)malloc(sizeof *bip);