#ifdef CONFIG_BPF_SYSCALL
static const struct seq_operations bpf_iter_udp_seq_ops;
-#endif
-static struct udp_table *udp_get_table_seq(struct seq_file *seq,
- struct net *net)
-{
- const struct udp_seq_afinfo *afinfo;
-
-#ifdef CONFIG_BPF_SYSCALL
- if (seq->op == &bpf_iter_udp_seq_ops)
- return net->ipv4.udp_table;
#endif
- afinfo = pde_data(file_inode(seq->file));
- return afinfo->udp_table ? : net->ipv4.udp_table;
-}
-
static struct sock *udp_get_first(struct seq_file *seq, int start)
{
struct udp_iter_state *state = seq->private;
struct udp_table *udptable;
struct sock *sk;
- udptable = udp_get_table_seq(seq, net);
+ udptable = net->ipv4.udp_table;
for (state->bucket = start; state->bucket <= udptable->mask;
++state->bucket) {
} while (sk && !seq_sk_match(seq, sk));
if (!sk) {
- udptable = udp_get_table_seq(seq, net);
+ udptable = net->ipv4.udp_table;
if (state->bucket <= udptable->mask)
spin_unlock_bh(&udptable->hash[state->bucket].lock);
struct udp_iter_state *state = seq->private;
struct udp_table *udptable;
- udptable = udp_get_table_seq(seq, seq_file_net(seq));
+ udptable = seq_file_net(seq)->ipv4.udp_table;
if (state->bucket <= udptable->mask)
spin_unlock_bh(&udptable->hash[state->bucket].lock);
if (iter->cur_sk == iter->end_sk)
state->bucket++;
- udptable = udp_get_table_seq(seq, net);
+ udptable = net->ipv4.udp_table;
again:
/* New batch for the next bucket.
static struct udp_seq_afinfo udp4_seq_afinfo = {
.family = AF_INET,
- .udp_table = NULL,
};
static int __net_init udp4_proc_init_net(struct net *net)