diff options
Diffstat (limited to 'sysdep')
-rw-r--r-- | sysdep/bsd/krt-sock.c | 5 | ||||
-rw-r--r-- | sysdep/linux/netlink/netlink.c | 8 | ||||
-rw-r--r-- | sysdep/unix/krt-iface.c | 4 |
3 files changed, 11 insertions, 6 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c index a3e17e2..a4df52e 100644 --- a/sysdep/bsd/krt-sock.c +++ b/sysdep/bsd/krt-sock.c @@ -543,6 +543,9 @@ krt_read_addr(struct ks_msg *msg) { ifa.prefix = ipa_and(ifa.ip, ipa_mkmask(masklen)); + if (masklen == BITS_PER_IP_ADDRESS) + ifa.flags |= IA_HOST; + if (masklen == (BITS_PER_IP_ADDRESS - 1)) ifa.opposite = ipa_opposite_m1(ifa.ip); @@ -553,7 +556,7 @@ krt_read_addr(struct ks_msg *msg) } else /* PtP iface */ { - ifa.flags |= IA_UNNUMBERED; + ifa.flags |= IA_PEER; ifa.prefix = ifa.opposite = ifa.brd; } diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index 3eaa53a..afca626 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -499,10 +499,12 @@ nl_parse_addr(struct nlmsghdr *h) ipa_ntoh(addr); ifa.prefix = ifa.brd = addr; - /* It is either a peer address, or loopback/dummy address */ - if (!ipa_equal(ifa.ip, addr)) + /* It is either a host address or a peer address */ + if (ipa_equal(ifa.ip, addr)) + ifa.flags |= IA_HOST; + else { - ifa.flags |= IA_UNNUMBERED; + ifa.flags |= IA_PEER; ifa.opposite = addr; } } diff --git a/sysdep/unix/krt-iface.c b/sysdep/unix/krt-iface.c index c305d27..69048ae 100644 --- a/sysdep/unix/krt-iface.c +++ b/sysdep/unix/krt-iface.c @@ -98,7 +98,7 @@ scan_ifs(struct ifreq *r, int cnt) if (fl & IFF_POINTOPOINT) { - a.flags |= IA_UNNUMBERED; + a.flags |= IA_PEER; if (ioctl(if_scan_sock, SIOCGIFDSTADDR, r) < 0) { err = "SIOCGIFDSTADDR"; goto faulty; } get_sockaddr((struct sockaddr_in *) &r->ifr_addr, &a.opposite, NULL, 1); @@ -114,7 +114,7 @@ scan_ifs(struct ifreq *r, int cnt) && (fl & IFF_MULTICAST) #endif #ifndef CONFIG_UNNUM_MULTICAST - && !(a.flags & IA_UNNUMBERED) + && !(a.flags & IA_PEER) #endif ) i.flags |= IF_MULTICAST; |