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>
This commit is contained in:

committed by
David S. Miller

parent
f7aa74e483
commit
fc6e8073f3
@@ -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
|
||||
|
Reference in New Issue
Block a user