aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-24 18:57:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-24 18:57:12 -0400
commit03746bad30890284cc14fc39184c5b60b9cb8bc9 (patch)
tree598728021adf309e2e46130bdef86ecf1b601054
parent719be62903a6e6419789557cb3ed0e840d3e4ca9 (diff)
parent3f5f4346b6d3c8bc33780a941da2473c4be2c989 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [8021Q]: vlan_ioctl_handler: fix return value [GENETLINK]: Correctly report errors while registering a multicast group [GENETLINK]: Fix adjustment of number of multicast groups [GENETLINK]: Fix race in genl_unregister_mc_groups() [NETFILTER]: Clean up duplicate includes in net/netfilter/ [NETFILTER]: Clean up duplicate includes in net/bridge/ [NETFILTER]: Fix logging regression [TCPv6] MD5SIG: Ensure to reset allocation count to avoid panic.
-rw-r--r--net/8021q/vlan.c2
-rw-r--r--net/bridge/netfilter/ebt_log.c7
-rw-r--r--net/bridge/netfilter/ebt_ulog.c9
-rw-r--r--net/ipv4/netfilter/ipt_LOG.c6
-rw-r--r--net/ipv6/netfilter/ip6t_LOG.c6
-rw-r--r--net/ipv6/tcp_ipv6.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_udp.c1
-rw-r--r--net/netfilter/nf_conntrack_proto_udplite.c1
-rw-r--r--net/netfilter/xt_physdev.c1
-rw-r--r--net/netlink/genetlink.c28
11 files changed, 29 insertions, 34 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index cda936b77d22..1583c5ef963f 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -810,6 +810,7 @@ static int vlan_ioctl_handler(void __user *arg)
810 err = -EINVAL; 810 err = -EINVAL;
811 break; 811 break;
812 case GET_VLAN_REALDEV_NAME_CMD: 812 case GET_VLAN_REALDEV_NAME_CMD:
813 err = 0;
813 vlan_dev_get_realdev_name(dev, args.u.device2); 814 vlan_dev_get_realdev_name(dev, args.u.device2);
814 if (copy_to_user(arg, &args, 815 if (copy_to_user(arg, &args,
815 sizeof(struct vlan_ioctl_args))) { 816 sizeof(struct vlan_ioctl_args))) {
@@ -818,6 +819,7 @@ static int vlan_ioctl_handler(void __user *arg)
818 break; 819 break;
819 820
820 case GET_VLAN_VID_CMD: 821 case GET_VLAN_VID_CMD:
822 err = 0;
821 vlan_dev_get_vid(dev, &vid); 823 vlan_dev_get_vid(dev, &vid);
822 args.u.VID = vid; 824 args.u.VID = vid;
823 if (copy_to_user(arg, &args, 825 if (copy_to_user(arg, &args,
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c
index 031bfa4a51fc..457815fb5584 100644
--- a/net/bridge/netfilter/ebt_log.c
+++ b/net/bridge/netfilter/ebt_log.c
@@ -9,7 +9,6 @@
9 * 9 *
10 */ 10 */
11 11
12#include <linux/in.h>
13#include <linux/netfilter_bridge/ebtables.h> 12#include <linux/netfilter_bridge/ebtables.h>
14#include <linux/netfilter_bridge/ebt_log.h> 13#include <linux/netfilter_bridge/ebt_log.h>
15#include <linux/netfilter.h> 14#include <linux/netfilter.h>
@@ -196,10 +195,8 @@ static int __init ebt_log_init(void)
196 ret = ebt_register_watcher(&log); 195 ret = ebt_register_watcher(&log);
197 if (ret < 0) 196 if (ret < 0)
198 return ret; 197 return ret;
199 ret = nf_log_register(PF_BRIDGE, &ebt_log_logger); 198 nf_log_register(PF_BRIDGE, &ebt_log_logger);
200 if (ret < 0 && ret != -EEXIST) 199 return 0;
201 ebt_unregister_watcher(&log);
202 return ret;
203} 200}
204 201
205static void __exit ebt_log_fini(void) 202static void __exit ebt_log_fini(void)
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index 9411db625917..204c968fa86d 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -36,7 +36,6 @@
36#include <linux/timer.h> 36#include <linux/timer.h>
37#include <linux/netlink.h> 37#include <linux/netlink.h>
38#include <linux/netdevice.h> 38#include <linux/netdevice.h>
39#include <linux/module.h>
40#include <linux/netfilter_bridge/ebtables.h> 39#include <linux/netfilter_bridge/ebtables.h>
41#include <linux/netfilter_bridge/ebt_ulog.h> 40#include <linux/netfilter_bridge/ebt_ulog.h>
42#include <net/sock.h> 41#include <net/sock.h>
@@ -308,12 +307,8 @@ static int __init ebt_ulog_init(void)
308 else if ((ret = ebt_register_watcher(&ulog))) 307 else if ((ret = ebt_register_watcher(&ulog)))
309 sock_release(ebtulognl->sk_socket); 308 sock_release(ebtulognl->sk_socket);
310 309
311 if (nf_log_register(PF_BRIDGE, &ebt_ulog_logger) < 0) { 310 if (ret == 0)
312 printk(KERN_WARNING "ebt_ulog: not logging via ulog " 311 nf_log_register(PF_BRIDGE, &ebt_ulog_logger);
313 "since somebody else already registered for PF_BRIDGE\n");
314 /* we cannot make module load fail here, since otherwise
315 * ebtables userspace would abort */
316 }
317 312
318 return ret; 313 return ret;
319} 314}
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 5937ad150b9f..127a5e89bf14 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -479,10 +479,8 @@ static int __init ipt_log_init(void)
479 ret = xt_register_target(&ipt_log_reg); 479 ret = xt_register_target(&ipt_log_reg);
480 if (ret < 0) 480 if (ret < 0)
481 return ret; 481 return ret;
482 ret = nf_log_register(PF_INET, &ipt_log_logger); 482 nf_log_register(PF_INET, &ipt_log_logger);
483 if (ret < 0 && ret != -EEXIST) 483 return 0;
484 xt_unregister_target(&ipt_log_reg);
485 return ret;
486} 484}
487 485
488static void __exit ipt_log_fini(void) 486static void __exit ipt_log_fini(void)
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index b05327ebd332..6ab99001dccc 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -493,10 +493,8 @@ static int __init ip6t_log_init(void)
493 ret = xt_register_target(&ip6t_log_reg); 493 ret = xt_register_target(&ip6t_log_reg);
494 if (ret < 0) 494 if (ret < 0)
495 return ret; 495 return ret;
496 ret = nf_log_register(PF_INET6, &ip6t_logger); 496 nf_log_register(PF_INET6, &ip6t_logger);
497 if (ret < 0 && ret != -EEXIST) 497 return 0;
498 xt_unregister_target(&ip6t_log_reg);
499 return ret;
500} 498}
501 499
502static void __exit ip6t_log_fini(void) 500static void __exit ip6t_log_fini(void)
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index d67fb1ef751e..f10f3689d671 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -633,6 +633,7 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer)
633 if (tp->md5sig_info->entries6 == 0) { 633 if (tp->md5sig_info->entries6 == 0) {
634 kfree(tp->md5sig_info->keys6); 634 kfree(tp->md5sig_info->keys6);
635 tp->md5sig_info->keys6 = NULL; 635 tp->md5sig_info->keys6 = NULL;
636 tp->md5sig_info->alloced6 = 0;
636 637
637 tcp_free_md5sig_pool(); 638 tcp_free_md5sig_pool();
638 639
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index 87ad3ccf8aff..eb3fe7401466 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -8,7 +8,6 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/netfilter.h>
12#include <linux/module.h> 11#include <linux/module.h>
13#include <linux/in.h> 12#include <linux/in.h>
14#include <linux/tcp.h> 13#include <linux/tcp.h>
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index 13d94a025723..2a2fd1a764ea 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -9,7 +9,6 @@
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/netfilter.h>
13#include <linux/udp.h> 12#include <linux/udp.h>
14#include <linux/seq_file.h> 13#include <linux/seq_file.h>
15#include <linux/skbuff.h> 14#include <linux/skbuff.h>
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c
index 93e747b5396e..b906b413997c 100644
--- a/net/netfilter/nf_conntrack_proto_udplite.c
+++ b/net/netfilter/nf_conntrack_proto_udplite.c
@@ -10,7 +10,6 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/timer.h> 11#include <linux/timer.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/netfilter.h>
14#include <linux/udp.h> 13#include <linux/udp.h>
15#include <linux/seq_file.h> 14#include <linux/seq_file.h>
16#include <linux/skbuff.h> 15#include <linux/skbuff.h>
diff --git a/net/netfilter/xt_physdev.c b/net/netfilter/xt_physdev.c
index f47cab7a696d..a4bab043a6d1 100644
--- a/net/netfilter/xt_physdev.c
+++ b/net/netfilter/xt_physdev.c
@@ -13,7 +13,6 @@
13#include <linux/netfilter_bridge.h> 13#include <linux/netfilter_bridge.h>
14#include <linux/netfilter/xt_physdev.h> 14#include <linux/netfilter/xt_physdev.h>
15#include <linux/netfilter/x_tables.h> 15#include <linux/netfilter/x_tables.h>
16#include <linux/netfilter_bridge.h>
17 16
18MODULE_LICENSE("GPL"); 17MODULE_LICENSE("GPL");
19MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>"); 18MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index e146531faf1d..8c11ca4a2121 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -184,7 +184,7 @@ int genl_register_mc_group(struct genl_family *family,
184 } 184 }
185 185
186 err = netlink_change_ngroups(genl_sock, 186 err = netlink_change_ngroups(genl_sock,
187 sizeof(unsigned long) * NETLINK_GENERIC); 187 mc_groups_longs * BITS_PER_LONG);
188 if (err) 188 if (err)
189 goto out; 189 goto out;
190 190
@@ -196,10 +196,22 @@ int genl_register_mc_group(struct genl_family *family,
196 genl_ctrl_event(CTRL_CMD_NEWMCAST_GRP, grp); 196 genl_ctrl_event(CTRL_CMD_NEWMCAST_GRP, grp);
197 out: 197 out:
198 genl_unlock(); 198 genl_unlock();
199 return 0; 199 return err;
200} 200}
201EXPORT_SYMBOL(genl_register_mc_group); 201EXPORT_SYMBOL(genl_register_mc_group);
202 202
203static void __genl_unregister_mc_group(struct genl_family *family,
204 struct genl_multicast_group *grp)
205{
206 BUG_ON(grp->family != family);
207 netlink_clear_multicast_users(genl_sock, grp->id);
208 clear_bit(grp->id, mc_groups);
209 list_del(&grp->list);
210 genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
211 grp->id = 0;
212 grp->family = NULL;
213}
214
203/** 215/**
204 * genl_unregister_mc_group - unregister a multicast group 216 * genl_unregister_mc_group - unregister a multicast group
205 * 217 *
@@ -217,14 +229,8 @@ EXPORT_SYMBOL(genl_register_mc_group);
217void genl_unregister_mc_group(struct genl_family *family, 229void genl_unregister_mc_group(struct genl_family *family,
218 struct genl_multicast_group *grp) 230 struct genl_multicast_group *grp)
219{ 231{
220 BUG_ON(grp->family != family);
221 genl_lock(); 232 genl_lock();
222 netlink_clear_multicast_users(genl_sock, grp->id); 233 __genl_unregister_mc_group(family, grp);
223 clear_bit(grp->id, mc_groups);
224 list_del(&grp->list);
225 genl_ctrl_event(CTRL_CMD_DELMCAST_GRP, grp);
226 grp->id = 0;
227 grp->family = NULL;
228 genl_unlock(); 234 genl_unlock();
229} 235}
230 236
@@ -232,8 +238,10 @@ static void genl_unregister_mc_groups(struct genl_family *family)
232{ 238{
233 struct genl_multicast_group *grp, *tmp; 239 struct genl_multicast_group *grp, *tmp;
234 240
241 genl_lock();
235 list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list) 242 list_for_each_entry_safe(grp, tmp, &family->mcast_groups, list)
236 genl_unregister_mc_group(family, grp); 243 __genl_unregister_mc_group(family, grp);
244 genl_unlock();
237} 245}
238 246
239/** 247/**