mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
neighbour: Remove unnecessary net_eq().
neigh_table is now per-netns, and net_eq() is no longer needed. Let's remove them. Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260902203722.926528-15-kuniyu@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
da5a7e7a90
commit
fae1c59810
|
|
@ -2662,9 +2662,6 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
|
||||||
nidx = 0;
|
nidx = 0;
|
||||||
p = list_next_entry(&tbl->parms, list);
|
p = list_next_entry(&tbl->parms, list);
|
||||||
list_for_each_entry_from_rcu(p, &tbl->parms_list, list) {
|
list_for_each_entry_from_rcu(p, &tbl->parms_list, list) {
|
||||||
if (!net_eq(neigh_parms_net(p), net))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (nidx < neigh_skip)
|
if (nidx < neigh_skip)
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
|
|
@ -2842,12 +2839,11 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
|
||||||
struct netlink_callback *cb,
|
struct netlink_callback *cb,
|
||||||
struct neigh_dump_filter *filter)
|
struct neigh_dump_filter *filter)
|
||||||
{
|
{
|
||||||
struct net *net = sock_net(skb->sk);
|
|
||||||
struct neighbour *n;
|
|
||||||
int err = 0, h, s_h = cb->args[1];
|
|
||||||
int idx, s_idx = idx = cb->args[2];
|
int idx, s_idx = idx = cb->args[2];
|
||||||
struct neigh_hash_table *nht;
|
int err = 0, h, s_h = cb->args[1];
|
||||||
unsigned int flags = NLM_F_MULTI;
|
unsigned int flags = NLM_F_MULTI;
|
||||||
|
struct neigh_hash_table *nht;
|
||||||
|
struct neighbour *n;
|
||||||
|
|
||||||
if (filter->dev_idx || filter->master_idx)
|
if (filter->dev_idx || filter->master_idx)
|
||||||
flags |= NLM_F_DUMP_FILTERED;
|
flags |= NLM_F_DUMP_FILTERED;
|
||||||
|
|
@ -2859,7 +2855,7 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
|
||||||
s_idx = 0;
|
s_idx = 0;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
neigh_for_each_in_bucket_rcu(n, &nht->hash_heads[h]) {
|
neigh_for_each_in_bucket_rcu(n, &nht->hash_heads[h]) {
|
||||||
if (idx < s_idx || !net_eq(dev_net(n->dev), net))
|
if (idx < s_idx)
|
||||||
goto next;
|
goto next;
|
||||||
if (neigh_ifindex_filtered(n->dev, filter->dev_idx) ||
|
if (neigh_ifindex_filtered(n->dev, filter->dev_idx) ||
|
||||||
neigh_master_filtered(n->dev, filter->master_idx))
|
neigh_master_filtered(n->dev, filter->master_idx))
|
||||||
|
|
@ -3264,10 +3260,6 @@ static struct neighbour *neigh_get_valid(struct seq_file *seq,
|
||||||
loff_t *pos)
|
loff_t *pos)
|
||||||
{
|
{
|
||||||
struct neigh_seq_state *state = seq->private;
|
struct neigh_seq_state *state = seq->private;
|
||||||
struct net *net = seq_file_net(seq);
|
|
||||||
|
|
||||||
if (!net_eq(dev_net(n->dev), net))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (state->neigh_sub_iter) {
|
if (state->neigh_sub_iter) {
|
||||||
loff_t fakep = 0;
|
loff_t fakep = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user