diff options
author | David Lamparter <equinox@diac24.net> | 2010-01-20 18:27:16 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-03 05:25:14 +0100 |
commit | 134f239b195209d96368caff9fac8e12d32334fb (patch) | |
tree | ca083bc70f8d591280e9cb48e08ee57fcab75edd | |
parent | 4215c0117a843d324c7a33ac56244252f0f40ed6 (diff) | |
download | quagga-134f239b195209d96368caff9fac8e12d32334fb.tar.bz2 quagga-134f239b195209d96368caff9fac8e12d32334fb.tar.xz |
zebra: netlink backend support setting a P-t-P address
add a few bits to properly set a pointopoint address via netlink. the
structures have all the neccessary support, just need to send the proper
message bits to the kernel.
-rw-r--r-- | zebra/rt_netlink.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 7652f80a..dfe88002 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1778,20 +1778,29 @@ netlink_address (int cmd, int family, struct interface *ifp, req.ifa.ifa_family = family; req.ifa.ifa_index = ifp->ifindex; - req.ifa.ifa_prefixlen = p->prefixlen; addattr_l (&req.n, sizeof req, IFA_LOCAL, &p->u.prefix, bytelen); - if (family == AF_INET && cmd == RTM_NEWADDR) + if (family == AF_INET) { - if (!CONNECTED_PEER(ifc) && ifc->destination) + if (CONNECTED_PEER(ifc)) { p = ifc->destination; - addattr_l (&req.n, sizeof req, IFA_BROADCAST, &p->u.prefix, + addattr_l (&req.n, sizeof req, IFA_ADDRESS, &p->u.prefix, bytelen); } + else + if (cmd == RTM_NEWADDR && ifc->destination) + { + p = ifc->destination; + addattr_l (&req.n, sizeof req, IFA_BROADCAST, &p->u.prefix, + bytelen); + } } + /* p is now either ifc->address or ifc->destination */ + req.ifa.ifa_prefixlen = p->prefixlen; + if (CHECK_FLAG (ifc->flags, ZEBRA_IFA_SECONDARY)) SET_FLAG (req.ifa.ifa_flags, IFA_F_SECONDARY); |