summaryrefslogtreecommitdiffstats
path: root/sysdep
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-05-26 16:09:22 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-05-26 16:09:22 +0200
commit691057f03310e712428e19214ae48462d0f258e1 (patch)
tree263e8ed83920f2dd9fd48bfba70e812c033629f3 /sysdep
parente0a62ad0f8be198bf8afb1f6900f138dfe12d4fb (diff)
downloadbird-691057f03310e712428e19214ae48462d0f258e1.tar
bird-691057f03310e712428e19214ae48462d0f258e1.zip
Support loopback/dummy addresses.
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/linux/netlink/netlink.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c
index 365d4a9..a10a2e9 100644
--- a/sysdep/linux/netlink/netlink.c
+++ b/sysdep/linux/netlink/netlink.c
@@ -382,10 +382,17 @@ nl_parse_addr(struct nlmsghdr *h)
}
if (i->ifa_prefixlen == BITS_PER_IP_ADDRESS)
{
- ifa.flags |= IA_UNNUMBERED;
- memcpy(&ifa.opposite, RTA_DATA(a[IFA_ADDRESS]), sizeof(ifa.opposite));
- ipa_ntoh(ifa.opposite);
- ifa.prefix = ifa.brd = ifa.opposite;
+ ip_addr addr;
+ memcpy(&addr, RTA_DATA(a[IFA_ADDRESS]), sizeof(addr));
+ ipa_ntoh(addr);
+ ifa.prefix = ifa.brd = addr;
+
+ /* It is either a peer address, or loopback/dummy address */
+ if (!ipa_equal(ifa.ip, addr))
+ {
+ ifa.flags |= IA_UNNUMBERED;
+ ifa.opposite = addr;
+ }
}
else
{