aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/tcp.h3
-rw-r--r--net/ipv4/tcp_ipv4.c14
-rw-r--r--net/ipv6/tcp_ipv6.c4
3 files changed, 12 insertions, 9 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index f5b61e0f01f2..2c9a650412c0 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1328,8 +1328,8 @@ struct tcp_seq_afinfo {
1328 struct module *owner; 1328 struct module *owner;
1329 char *name; 1329 char *name;
1330 sa_family_t family; 1330 sa_family_t family;
1331 int (*seq_show) (struct seq_file *m, void *v);
1332 struct file_operations *seq_fops; 1331 struct file_operations *seq_fops;
1332 struct seq_operations seq_ops;
1333}; 1333};
1334 1334
1335struct tcp_iter_state { 1335struct tcp_iter_state {
@@ -1338,7 +1338,6 @@ struct tcp_iter_state {
1338 enum tcp_seq_states state; 1338 enum tcp_seq_states state;
1339 struct sock *syn_wait_sk; 1339 struct sock *syn_wait_sk;
1340 int bucket, sbucket, num, uid; 1340 int bucket, sbucket, num, uid;
1341 struct seq_operations seq_ops;
1342}; 1341};
1343 1342
1344extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo); 1343extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 978d9db1df34..c50dd1793643 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2229,13 +2229,9 @@ static int tcp_seq_open(struct inode *inode, struct file *file)
2229 goto out_kfree; 2229 goto out_kfree;
2230 2230
2231 s->family = afinfo->family; 2231 s->family = afinfo->family;
2232 s->seq_ops.start = tcp_seq_start;
2233 s->seq_ops.next = tcp_seq_next;
2234 s->seq_ops.show = afinfo->seq_show;
2235 s->seq_ops.stop = tcp_seq_stop;
2236 s->p.net = net; 2232 s->p.net = net;
2237 2233
2238 rc = seq_open(file, &s->seq_ops); 2234 rc = seq_open(file, &afinfo->seq_ops);
2239 if (rc) 2235 if (rc)
2240 goto out_put_net; 2236 goto out_put_net;
2241 seq = file->private_data; 2237 seq = file->private_data;
@@ -2269,6 +2265,10 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo)
2269 afinfo->seq_fops->llseek = seq_lseek; 2265 afinfo->seq_fops->llseek = seq_lseek;
2270 afinfo->seq_fops->release = tcp_seq_release; 2266 afinfo->seq_fops->release = tcp_seq_release;
2271 2267
2268 afinfo->seq_ops.start = tcp_seq_start;
2269 afinfo->seq_ops.next = tcp_seq_next;
2270 afinfo->seq_ops.stop = tcp_seq_stop;
2271
2272 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops); 2272 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, afinfo->seq_fops);
2273 if (p) 2273 if (p)
2274 p->data = afinfo; 2274 p->data = afinfo;
@@ -2414,8 +2414,10 @@ static struct tcp_seq_afinfo tcp4_seq_afinfo = {
2414 .owner = THIS_MODULE, 2414 .owner = THIS_MODULE,
2415 .name = "tcp", 2415 .name = "tcp",
2416 .family = AF_INET, 2416 .family = AF_INET,
2417 .seq_show = tcp4_seq_show,
2418 .seq_fops = &tcp4_seq_fops, 2417 .seq_fops = &tcp4_seq_fops,
2418 .seq_ops = {
2419 .show = tcp4_seq_show,
2420 },
2419}; 2421};
2420 2422
2421static int tcp4_proc_init_net(struct net *net) 2423static int tcp4_proc_init_net(struct net *net)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 80eab71e77ff..8bf59ee51cdb 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2125,8 +2125,10 @@ static struct tcp_seq_afinfo tcp6_seq_afinfo = {
2125 .owner = THIS_MODULE, 2125 .owner = THIS_MODULE,
2126 .name = "tcp6", 2126 .name = "tcp6",
2127 .family = AF_INET6, 2127 .family = AF_INET6,
2128 .seq_show = tcp6_seq_show,
2129 .seq_fops = &tcp6_seq_fops, 2128 .seq_fops = &tcp6_seq_fops,
2129 .seq_ops = {
2130 .show = tcp6_seq_show,
2131 },
2130}; 2132};
2131 2133
2132int tcp6_proc_init(struct net *net) 2134int tcp6_proc_init(struct net *net)