struct hlist_node *node;
struct sock *sk = cur;
struct tcp_iter_state* st = seq->private;
- struct net *net = st->net;
+ struct net *net = seq_file_net(seq);
if (!sk) {
st->bucket = 0;
static void *established_get_first(struct seq_file *seq)
{
struct tcp_iter_state* st = seq->private;
- struct net *net = st->net;
+ struct net *net = seq_file_net(seq);
void *rc = NULL;
for (st->bucket = 0; st->bucket < tcp_hashinfo.ehash_size; ++st->bucket) {
struct inet_timewait_sock *tw;
struct hlist_node *node;
struct tcp_iter_state* st = seq->private;
- struct net *net = st->net;
+ struct net *net = seq_file_net(seq);
++st->num;
s->seq_ops.next = tcp_seq_next;
s->seq_ops.show = afinfo->seq_show;
s->seq_ops.stop = tcp_seq_stop;
- s->net = net;
+ s->p.net = net;
rc = seq_open(file, &s->seq_ops);
if (rc)
static int tcp_seq_release(struct inode *inode, struct file *file)
{
struct seq_file *seq = file->private_data;
- struct tcp_iter_state *s = seq->private;
- put_net(s->net);
+ put_net(seq_file_net(seq));
seq_release_private(inode, file);
return 0;
}