neighbor: Move neigh_update_ext_learned to core file
authorDavid Ahern <dsahern@gmail.com>
Wed, 12 Dec 2018 01:57:24 +0000 (18:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Dec 2018 23:44:47 +0000 (15:44 -0800)
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>
include/net/neighbour.h
net/core/neighbour.c

index f886b58956a69b54656fc52c90a41429e7bf699a..ef0a60448a96c9463e333675adee44ff61ea7790 100644 (file)
@@ -549,24 +549,6 @@ static inline void neigh_ha_snapshot(char *dst, const struct neighbour *n,
        } while (read_seqretry(&n->ha_lock, seq));
 }
 
-static inline void neigh_update_ext_learned(struct neighbour *neigh, u32 flags,
-                                           int *notify)
-{
-       u8 ndm_flags = 0;
-
-       if (!(flags & NEIGH_UPDATE_F_ADMIN))
-               return;
-
-       ndm_flags |= (flags & NEIGH_UPDATE_F_EXT_LEARNED) ? NTF_EXT_LEARNED : 0;
-       if ((neigh->flags ^ ndm_flags) & NTF_EXT_LEARNED) {
-               if (ndm_flags & NTF_EXT_LEARNED)
-                       neigh->flags |= NTF_EXT_LEARNED;
-               else
-                       neigh->flags &= ~NTF_EXT_LEARNED;
-               *notify = 1;
-       }
-}
-
 static inline void neigh_update_is_router(struct neighbour *neigh, u32 flags,
                                          int *notify)
 {
index bb6f9ca7a3cea63501faa05c829437989874bb30..2401040f799b33d997e46c9b9234759beb94ca8c 100644 (file)
@@ -153,6 +153,24 @@ static void neigh_update_gc_list(struct neighbour *n)
        write_unlock_bh(&n->tbl->lock);
 }
 
+static void neigh_update_ext_learned(struct neighbour *neigh, u32 flags,
+                                    int *notify)
+{
+       u8 ndm_flags;
+
+       if (!(flags & NEIGH_UPDATE_F_ADMIN))
+               return;
+
+       ndm_flags = (flags & NEIGH_UPDATE_F_EXT_LEARNED) ? NTF_EXT_LEARNED : 0;
+       if ((neigh->flags ^ ndm_flags) & NTF_EXT_LEARNED) {
+               if (ndm_flags & NTF_EXT_LEARNED)
+                       neigh->flags |= NTF_EXT_LEARNED;
+               else
+                       neigh->flags &= ~NTF_EXT_LEARNED;
+               *notify = 1;
+       }
+}
+
 static bool neigh_del(struct neighbour *n, struct neighbour __rcu **np,
                      struct neigh_table *tbl)
 {