mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 14:07:39 +00:00
STABLE14-rx-getaddrs-skip-loopback-addr-on-bsd-too-20050326
as reported by Tracy Demarco-White (cherry picked from commit 4cbe2e7ebfc993a3d09d558cd58757e0b858facd)
This commit is contained in:
parent
7f4cdf1760
commit
731165ecda
@ -284,26 +284,28 @@ rxi_getAllAddrMaskMtu(afs_int32 addrBuffer[], afs_int32 maskBuffer[],
|
||||
continue;
|
||||
a = info.rti_info[RTAX_IFA];
|
||||
|
||||
if (count >= maxSize) { /* no more space */
|
||||
printf("Too many interfaces..ignoring 0x%x\n",
|
||||
a->sin_addr.s_addr);
|
||||
} else {
|
||||
struct ifreq ifr;
|
||||
|
||||
addrBuffer[count] = a->sin_addr.s_addr;
|
||||
a = info.rti_info[RTAX_NETMASK];
|
||||
if (a)
|
||||
maskBuffer[count] = a->sin_addr.s_addr;
|
||||
else
|
||||
maskBuffer[count] = htonl(0xffffffff);
|
||||
memset(&ifr, sizeof(ifr), 0);
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
strncpy(ifr.ifr_name, sdl->sdl_data, sdl->sdl_nlen);
|
||||
if (ioctl(s, SIOCGIFMTU, (caddr_t) & ifr) < 0)
|
||||
mtuBuffer[count] = htonl(1500);
|
||||
else
|
||||
mtuBuffer[count] = htonl(ifr.ifr_mtu);
|
||||
count++;
|
||||
if (a->sin_addr.s_addr != htonl(0x7f000001) ) {
|
||||
if (count >= maxSize) { /* no more space */
|
||||
printf("Too many interfaces..ignoring 0x%x\n",
|
||||
a->sin_addr.s_addr);
|
||||
} else {
|
||||
struct ifreq ifr;
|
||||
|
||||
addrBuffer[count] = a->sin_addr.s_addr;
|
||||
a = info.rti_info[RTAX_NETMASK];
|
||||
if (a)
|
||||
maskBuffer[count] = a->sin_addr.s_addr;
|
||||
else
|
||||
maskBuffer[count] = htonl(0xffffffff);
|
||||
memset(&ifr, sizeof(ifr), 0);
|
||||
ifr.ifr_addr.sa_family = AF_INET;
|
||||
strncpy(ifr.ifr_name, sdl->sdl_data, sdl->sdl_nlen);
|
||||
if (ioctl(s, SIOCGIFMTU, (caddr_t) & ifr) < 0)
|
||||
mtuBuffer[count] = htonl(1500);
|
||||
else
|
||||
mtuBuffer[count] = htonl(ifr.ifr_mtu);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
addrcount--;
|
||||
ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen);
|
||||
|
Loading…
x
Reference in New Issue
Block a user