summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-09-24 12:21:33 -0700
committerDavid S. Miller <davem@davemloft.net>2018-09-24 12:21:33 -0700
commit094fe7392d6e0c8fa516dca451d4e005a2238e28 (patch)
treed3f4fecf55349f4de7a7c8a9f3faafb394632d20 /include
parentea49c6f0bacaa4cf8980258584059de35ad54b8f (diff)
parentfc6e8073f304010605f834cb2eb8c07c46461c9d (diff)
downloadcachepc-linux-094fe7392d6e0c8fa516dca451d4e005a2238e28.tar.gz
cachepc-linux-094fe7392d6e0c8fa516dca451d4e005a2238e28.zip
Merge branch 'few-NTF_ROUTER-related-updates'
Roopa Prabhu says: ==================== few NTF_ROUTER related updates This series allows setting of NTF_ROUTER by an external entity (eg BGP E-VPN control plane). Also fixes missing netlink notification on neigh NTF_ROUTER flag changes. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/neighbour.h15
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,
*notify = 1;
}
}
+
+static inline void neigh_update_is_router(struct neighbour *neigh, u32 flags,
+ int *notify)
+{
+ u8 ndm_flags = 0;
+
+ ndm_flags |= (flags & NEIGH_UPDATE_F_ISROUTER) ? NTF_ROUTER : 0;
+ if ((neigh->flags ^ ndm_flags) & NTF_ROUTER) {
+ if (ndm_flags & NTF_ROUTER)
+ neigh->flags |= NTF_ROUTER;
+ else
+ neigh->flags &= ~NTF_ROUTER;
+ *notify = 1;
+ }
+}
#endif