Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

neighbour: Define neigh_for_each_in_bucket

Introduce neigh_for_each_in_bucket in neighbour.h, to help iterate over
the neighbour table more succinctly.

Signed-off-by: Gilad Naaman <gnaaman@drivenets.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20241107160444.2913124-3-gnaaman@drivenets.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Gilad Naaman and committed by
Jakub Kicinski
d7ddee1a 41b3caa7

+6
+6
include/net/neighbour.h
··· 277 277 278 278 extern const struct nla_policy nda_policy[]; 279 279 280 + #define neigh_for_each_in_bucket(pos, head) hlist_for_each_entry(pos, head, hash) 281 + #define neigh_for_each_in_bucket_rcu(pos, head) \ 282 + hlist_for_each_entry_rcu(pos, head, hash) 283 + #define neigh_for_each_in_bucket_safe(pos, tmp, head) \ 284 + hlist_for_each_entry_safe(pos, tmp, head, hash) 285 + 280 286 static inline bool neigh_key_eq32(const struct neighbour *n, const void *pkey) 281 287 { 282 288 return *(const u32 *)n->primary_key == *(const u32 *)pkey;