mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 00:19:28 +00:00
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. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
a3008857cb
commit
e8d19a0507
@ -830,18 +830,24 @@ static int netlink_address(int cmd, int family, struct interface *ifp,
|
|||||||
req.ifa.ifa_family = family;
|
req.ifa.ifa_family = family;
|
||||||
|
|
||||||
req.ifa.ifa_index = ifp->ifindex;
|
req.ifa.ifa_index = ifp->ifindex;
|
||||||
req.ifa.ifa_prefixlen = p->prefixlen;
|
|
||||||
|
|
||||||
addattr_l(&req.n, sizeof req, IFA_LOCAL, &p->u.prefix, bytelen);
|
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_ADDRESS,
|
||||||
|
&p->u.prefix, bytelen);
|
||||||
|
} else if (cmd == RTM_NEWADDR && ifc->destination) {
|
||||||
p = ifc->destination;
|
p = ifc->destination;
|
||||||
addattr_l(&req.n, sizeof req, IFA_BROADCAST,
|
addattr_l(&req.n, sizeof req, IFA_BROADCAST,
|
||||||
&p->u.prefix, bytelen);
|
&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))
|
if (CHECK_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY))
|
||||||
SET_FLAG(req.ifa.ifa_flags, IFA_F_SECONDARY);
|
SET_FLAG(req.ifa.ifa_flags, IFA_F_SECONDARY);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user