diff options
author | Roopa Prabhu <roopa@cumulusnetworks.com> | 2018-09-22 21:26:19 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-24 12:21:32 -0700 |
commit | f7aa74e483e81c7a064ebc29e5deeb6b31cde412 (patch) | |
tree | 24713cfc1c580bea927a4053a1709b287516af11 | |
parent | ea49c6f0bacaa4cf8980258584059de35ad54b8f (diff) |
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: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/neighbour.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 91592fceeaad..0e1cad89184f 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1712,7 +1712,8 @@ out: static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, 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 ndmsg *ndm; struct nlattr *tb[NDA_MAX+1]; @@ -1787,12 +1788,16 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, } 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) flags |= NEIGH_UPDATE_F_EXT_LEARNED; + if (ndm->ndm_flags & NTF_ROUTER) + flags |= NEIGH_UPDATE_F_ISROUTER; + if (ndm->ndm_flags & NTF_USE) { neigh_event_send(neigh, NULL); err = 0; |