diff --git a/include/net/neighbour.h b/include/net/neighbour.h index ed9d9ae6d3a6..79a5a548a129 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -554,30 +554,6 @@ static inline int neigh_output(struct neighbour *n, struct sk_buff *skb, return READ_ONCE(n->output)(n, skb); } -static inline struct neighbour * -__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) -{ - struct neighbour *n = neigh_lookup(tbl, pkey, dev); - - if (n || !creat) - return n; - - n = neigh_create(tbl, pkey, dev); - return IS_ERR(n) ? NULL : n; -} - -static inline struct neighbour * -__neigh_lookup_errno(struct neigh_table *tbl, const void *pkey, - struct net_device *dev) -{ - struct neighbour *n = neigh_lookup(tbl, pkey, dev); - - if (n) - return n; - - return neigh_create(tbl, pkey, dev); -} - struct neighbour_cb { unsigned long sched_next; unsigned int flags; diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 6ed8eb075146..0d883c043956 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1569,8 +1569,13 @@ struct neighbour *neigh_event_ns(struct neigh_table *tbl, u8 *lladdr, void *saddr, struct net_device *dev) { - struct neighbour *neigh = __neigh_lookup(tbl, saddr, dev, - lladdr || !dev->addr_len); + struct neighbour *neigh = neigh_lookup(tbl, saddr, dev); + + if (!neigh && (lladdr || !dev->addr_len)) { + neigh = neigh_create(tbl, saddr, dev); + if (IS_ERR(neigh)) + neigh = NULL; + } if (neigh) neigh_update(neigh, lladdr, NUD_STALE, NEIGH_UPDATE_F_OVERRIDE, 0);