diff options
author | Roopa Prabhu <roopa@cumulusnetworks.com> | 2018-09-23 00:26:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-24 15:21:32 -0400 |
commit | fc6e8073f304010605f834cb2eb8c07c46461c9d (patch) | |
tree | d3f4fecf55349f4de7a7c8a9f3faafb394632d20 /include/net/neighbour.h | |
parent | f7aa74e483e81c7a064ebc29e5deeb6b31cde412 (diff) |
neighbour: send netlink notification if NTF_ROUTER changes
send netlink notification if neigh_update results in NTF_ROUTER
change and if NEIGH_UPDATE_F_ISROUTER is on. Also move the
NTF_ROUTER change function into a helper.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6c1eecd56a4d..0874f7fcd859 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -544,4 +544,19 @@ static inline void neigh_update_ext_learned(struct neighbour *neigh, u32 flags, | |||
544 | *notify = 1; | 544 | *notify = 1; |
545 | } | 545 | } |
546 | } | 546 | } |
547 | |||
548 | static inline void neigh_update_is_router(struct neighbour *neigh, u32 flags, | ||
549 | int *notify) | ||
550 | { | ||
551 | u8 ndm_flags = 0; | ||
552 | |||
553 | ndm_flags |= (flags & NEIGH_UPDATE_F_ISROUTER) ? NTF_ROUTER : 0; | ||
554 | if ((neigh->flags ^ ndm_flags) & NTF_ROUTER) { | ||
555 | if (ndm_flags & NTF_ROUTER) | ||
556 | neigh->flags |= NTF_ROUTER; | ||
557 | else | ||
558 | neigh->flags &= ~NTF_ROUTER; | ||
559 | *notify = 1; | ||
560 | } | ||
561 | } | ||
547 | #endif | 562 | #endif |