diff options
author | David Ahern <dsahern@gmail.com> | 2018-12-11 20:57:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-14 18:44:47 -0500 |
commit | 526f1b587cf826d78c3e522428ce6b24a8da0d65 (patch) | |
tree | f28c66801db109cd5e67119540b434a52f5c23b7 | |
parent | 7e6f182bec7debb420a2c12ae0ea1813645a7ac4 (diff) |
neighbor: Move neigh_update_ext_learned to core file
neigh_update_ext_learned has one caller in neighbour.c so does not need
to be defined in the header. Move it and in the process remove the
intialization of ndm_flags and just set it based on the flags check.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/neighbour.h | 18 | ||||
-rw-r--r-- | net/core/neighbour.c | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index f886b58956a6..ef0a60448a96 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -549,24 +549,6 @@ static inline void neigh_ha_snapshot(char *dst, const struct neighbour *n, | |||
549 | } while (read_seqretry(&n->ha_lock, seq)); | 549 | } while (read_seqretry(&n->ha_lock, seq)); |
550 | } | 550 | } |
551 | 551 | ||
552 | static inline void neigh_update_ext_learned(struct neighbour *neigh, u32 flags, | ||
553 | int *notify) | ||
554 | { | ||
555 | u8 ndm_flags = 0; | ||
556 | |||
557 | if (!(flags & NEIGH_UPDATE_F_ADMIN)) | ||
558 | return; | ||
559 | |||
560 | ndm_flags |= (flags & NEIGH_UPDATE_F_EXT_LEARNED) ? NTF_EXT_LEARNED : 0; | ||
561 | if ((neigh->flags ^ ndm_flags) & NTF_EXT_LEARNED) { | ||
562 | if (ndm_flags & NTF_EXT_LEARNED) | ||
563 | neigh->flags |= NTF_EXT_LEARNED; | ||
564 | else | ||
565 | neigh->flags &= ~NTF_EXT_LEARNED; | ||
566 | *notify = 1; | ||
567 | } | ||
568 | } | ||
569 | |||
570 | static inline void neigh_update_is_router(struct neighbour *neigh, u32 flags, | 552 | static inline void neigh_update_is_router(struct neighbour *neigh, u32 flags, |
571 | int *notify) | 553 | int *notify) |
572 | { | 554 | { |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index bb6f9ca7a3ce..2401040f799b 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -153,6 +153,24 @@ static void neigh_update_gc_list(struct neighbour *n) | |||
153 | write_unlock_bh(&n->tbl->lock); | 153 | write_unlock_bh(&n->tbl->lock); |
154 | } | 154 | } |
155 | 155 | ||
156 | static void neigh_update_ext_learned(struct neighbour *neigh, u32 flags, | ||
157 | int *notify) | ||
158 | { | ||
159 | u8 ndm_flags; | ||
160 | |||
161 | if (!(flags & NEIGH_UPDATE_F_ADMIN)) | ||
162 | return; | ||
163 | |||
164 | ndm_flags = (flags & NEIGH_UPDATE_F_EXT_LEARNED) ? NTF_EXT_LEARNED : 0; | ||
165 | if ((neigh->flags ^ ndm_flags) & NTF_EXT_LEARNED) { | ||
166 | if (ndm_flags & NTF_EXT_LEARNED) | ||
167 | neigh->flags |= NTF_EXT_LEARNED; | ||
168 | else | ||
169 | neigh->flags &= ~NTF_EXT_LEARNED; | ||
170 | *notify = 1; | ||
171 | } | ||
172 | } | ||
173 | |||
156 | static bool neigh_del(struct neighbour *n, struct neighbour __rcu **np, | 174 | static bool neigh_del(struct neighbour *n, struct neighbour __rcu **np, |
157 | struct neigh_table *tbl) | 175 | struct neigh_table *tbl) |
158 | { | 176 | { |