diff options
Diffstat (limited to 'net/wireless/wext.c')
-rw-r--r-- | net/wireless/wext.c | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/net/wireless/wext.c b/net/wireless/wext.c index 47e80cc2077c..2c569b63e7d8 100644 --- a/net/wireless/wext.c +++ b/net/wireless/wext.c | |||
@@ -417,20 +417,6 @@ static const int event_type_size[] = { | |||
417 | IW_EV_QUAL_LEN, /* IW_HEADER_TYPE_QUAL */ | 417 | IW_EV_QUAL_LEN, /* IW_HEADER_TYPE_QUAL */ |
418 | }; | 418 | }; |
419 | 419 | ||
420 | /* Size (in bytes) of various events, as packed */ | ||
421 | static const int event_type_pk_size[] = { | ||
422 | IW_EV_LCP_PK_LEN, /* IW_HEADER_TYPE_NULL */ | ||
423 | 0, | ||
424 | IW_EV_CHAR_PK_LEN, /* IW_HEADER_TYPE_CHAR */ | ||
425 | 0, | ||
426 | IW_EV_UINT_PK_LEN, /* IW_HEADER_TYPE_UINT */ | ||
427 | IW_EV_FREQ_PK_LEN, /* IW_HEADER_TYPE_FREQ */ | ||
428 | IW_EV_ADDR_PK_LEN, /* IW_HEADER_TYPE_ADDR */ | ||
429 | 0, | ||
430 | IW_EV_POINT_PK_LEN, /* Without variable payload */ | ||
431 | IW_EV_PARAM_PK_LEN, /* IW_HEADER_TYPE_PARAM */ | ||
432 | IW_EV_QUAL_PK_LEN, /* IW_HEADER_TYPE_QUAL */ | ||
433 | }; | ||
434 | 420 | ||
435 | /************************ COMMON SUBROUTINES ************************/ | 421 | /************************ COMMON SUBROUTINES ************************/ |
436 | /* | 422 | /* |
@@ -673,26 +659,8 @@ static const struct seq_operations wireless_seq_ops = { | |||
673 | 659 | ||
674 | static int wireless_seq_open(struct inode *inode, struct file *file) | 660 | static int wireless_seq_open(struct inode *inode, struct file *file) |
675 | { | 661 | { |
676 | struct seq_file *seq; | 662 | return seq_open_net(inode, file, &wireless_seq_ops, |
677 | int res; | 663 | sizeof(struct seq_net_private)); |
678 | res = seq_open(file, &wireless_seq_ops); | ||
679 | if (!res) { | ||
680 | seq = file->private_data; | ||
681 | seq->private = get_proc_net(inode); | ||
682 | if (!seq->private) { | ||
683 | seq_release(inode, file); | ||
684 | res = -ENXIO; | ||
685 | } | ||
686 | } | ||
687 | return res; | ||
688 | } | ||
689 | |||
690 | static int wireless_seq_release(struct inode *inode, struct file *file) | ||
691 | { | ||
692 | struct seq_file *seq = file->private_data; | ||
693 | struct net *net = seq->private; | ||
694 | put_net(net); | ||
695 | return seq_release(inode, file); | ||
696 | } | 664 | } |
697 | 665 | ||
698 | static const struct file_operations wireless_seq_fops = { | 666 | static const struct file_operations wireless_seq_fops = { |
@@ -700,7 +668,7 @@ static const struct file_operations wireless_seq_fops = { | |||
700 | .open = wireless_seq_open, | 668 | .open = wireless_seq_open, |
701 | .read = seq_read, | 669 | .read = seq_read, |
702 | .llseek = seq_lseek, | 670 | .llseek = seq_lseek, |
703 | .release = wireless_seq_release, | 671 | .release = seq_release_net, |
704 | }; | 672 | }; |
705 | 673 | ||
706 | int wext_proc_init(struct net *net) | 674 | int wext_proc_init(struct net *net) |
@@ -1137,7 +1105,7 @@ static void wireless_nlevent_process(unsigned long data) | |||
1137 | struct sk_buff *skb; | 1105 | struct sk_buff *skb; |
1138 | 1106 | ||
1139 | while ((skb = skb_dequeue(&wireless_nlevent_queue))) | 1107 | while ((skb = skb_dequeue(&wireless_nlevent_queue))) |
1140 | rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); | 1108 | rtnl_notify(skb, &init_net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); |
1141 | } | 1109 | } |
1142 | 1110 | ||
1143 | static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0); | 1111 | static DECLARE_TASKLET(wireless_nlevent_tasklet, wireless_nlevent_process, 0); |
@@ -1189,6 +1157,9 @@ static void rtmsg_iwinfo(struct net_device *dev, char *event, int event_len) | |||
1189 | struct sk_buff *skb; | 1157 | struct sk_buff *skb; |
1190 | int err; | 1158 | int err; |
1191 | 1159 | ||
1160 | if (dev->nd_net != &init_net) | ||
1161 | return; | ||
1162 | |||
1192 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); | 1163 | skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
1193 | if (!skb) | 1164 | if (!skb) |
1194 | return; | 1165 | return; |