Commit f7aa74e4 authored by Roopa Prabhu's avatar Roopa Prabhu Committed by David S. Miller

neighbour: allow admin to set NTF_ROUTER

This patch allows admin setting of NTF_ROUTER flag
on a neighbour entry. This enables external control
plane (like bgp evpn) to manage neigh entries with
NTF_ROUTER flag.
Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ea49c6f0
...@@ -1712,7 +1712,8 @@ static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, ...@@ -1712,7 +1712,8 @@ static int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh,
static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE; int flags = NEIGH_UPDATE_F_ADMIN | NEIGH_UPDATE_F_OVERRIDE |
NEIGH_UPDATE_F_OVERRIDE_ISROUTER;
struct net *net = sock_net(skb->sk); struct net *net = sock_net(skb->sk);
struct ndmsg *ndm; struct ndmsg *ndm;
struct nlattr *tb[NDA_MAX+1]; struct nlattr *tb[NDA_MAX+1];
...@@ -1787,12 +1788,16 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, ...@@ -1787,12 +1788,16 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh,
} }
if (!(nlh->nlmsg_flags & NLM_F_REPLACE)) if (!(nlh->nlmsg_flags & NLM_F_REPLACE))
flags &= ~NEIGH_UPDATE_F_OVERRIDE; flags &= ~(NEIGH_UPDATE_F_OVERRIDE |
NEIGH_UPDATE_F_OVERRIDE_ISROUTER);
} }
if (ndm->ndm_flags & NTF_EXT_LEARNED) if (ndm->ndm_flags & NTF_EXT_LEARNED)
flags |= NEIGH_UPDATE_F_EXT_LEARNED; flags |= NEIGH_UPDATE_F_EXT_LEARNED;
if (ndm->ndm_flags & NTF_ROUTER)
flags |= NEIGH_UPDATE_F_ISROUTER;
if (ndm->ndm_flags & NTF_USE) { if (ndm->ndm_flags & NTF_USE) {
neigh_event_send(neigh, NULL); neigh_event_send(neigh, NULL);
err = 0; err = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment