diff options
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index e639645e8fec..c7bfeff10767 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -2361,13 +2361,15 @@ static int packet_release(struct socket *sock) | |||
2361 | 2361 | ||
2362 | packet_flush_mclist(sk); | 2362 | packet_flush_mclist(sk); |
2363 | 2363 | ||
2364 | memset(&req_u, 0, sizeof(req_u)); | 2364 | if (po->rx_ring.pg_vec) { |
2365 | 2365 | memset(&req_u, 0, sizeof(req_u)); | |
2366 | if (po->rx_ring.pg_vec) | ||
2367 | packet_set_ring(sk, &req_u, 1, 0); | 2366 | packet_set_ring(sk, &req_u, 1, 0); |
2367 | } | ||
2368 | 2368 | ||
2369 | if (po->tx_ring.pg_vec) | 2369 | if (po->tx_ring.pg_vec) { |
2370 | memset(&req_u, 0, sizeof(req_u)); | ||
2370 | packet_set_ring(sk, &req_u, 1, 1); | 2371 | packet_set_ring(sk, &req_u, 1, 1); |
2372 | } | ||
2371 | 2373 | ||
2372 | fanout_release(sk); | 2374 | fanout_release(sk); |
2373 | 2375 | ||
@@ -3826,7 +3828,7 @@ static int __net_init packet_net_init(struct net *net) | |||
3826 | mutex_init(&net->packet.sklist_lock); | 3828 | mutex_init(&net->packet.sklist_lock); |
3827 | INIT_HLIST_HEAD(&net->packet.sklist); | 3829 | INIT_HLIST_HEAD(&net->packet.sklist); |
3828 | 3830 | ||
3829 | if (!proc_net_fops_create(net, "packet", 0, &packet_seq_fops)) | 3831 | if (!proc_create("packet", 0, net->proc_net, &packet_seq_fops)) |
3830 | return -ENOMEM; | 3832 | return -ENOMEM; |
3831 | 3833 | ||
3832 | return 0; | 3834 | return 0; |
@@ -3834,7 +3836,7 @@ static int __net_init packet_net_init(struct net *net) | |||
3834 | 3836 | ||
3835 | static void __net_exit packet_net_exit(struct net *net) | 3837 | static void __net_exit packet_net_exit(struct net *net) |
3836 | { | 3838 | { |
3837 | proc_net_remove(net, "packet"); | 3839 | remove_proc_entry("packet", net->proc_net); |
3838 | } | 3840 | } |
3839 | 3841 | ||
3840 | static struct pernet_operations packet_net_ops = { | 3842 | static struct pernet_operations packet_net_ops = { |