Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-drm-fsl-dcu.git] / net / ipv4 / netfilter / ip_nat_irc.c
index de31942babe399e3fe9a58919505276662c04bf9..cfaeea38314f380735fe938662f730197c3afc24 100644 (file)
@@ -88,36 +88,35 @@ static unsigned int help(struct sk_buff **pskb,
        DEBUGP("ip_nat_irc: Inserting '%s' == %u.%u.%u.%u, port %u\n",
               buffer, NIPQUAD(exp->tuple.src.ip), port);
 
-       ret = ip_nat_mangle_tcp_packet(pskb, exp->master, ctinfo, 
-                                      matchoff, matchlen, buffer, 
+       ret = ip_nat_mangle_tcp_packet(pskb, exp->master, ctinfo,
+                                      matchoff, matchlen, buffer,
                                       strlen(buffer));
        if (ret != NF_ACCEPT)
                ip_conntrack_unexpect_related(exp);
        return ret;
 }
 
-static void __exit fini(void)
+static void __exit ip_nat_irc_fini(void)
 {
-       ip_nat_irc_hook = NULL;
-       /* Make sure noone calls it, meanwhile. */
-       synchronize_net();
+       rcu_assign_pointer(ip_nat_irc_hook, NULL);
+       synchronize_rcu();
 }
 
-static int __init init(void)
+static int __init ip_nat_irc_init(void)
 {
-       BUG_ON(ip_nat_irc_hook);
-       ip_nat_irc_hook = help;
+       BUG_ON(rcu_dereference(ip_nat_irc_hook));
+       rcu_assign_pointer(ip_nat_irc_hook, help);
        return 0;
 }
 
 /* Prior to 2.6.11, we had a ports param.  No longer, but don't break users. */
 static int warn_set(const char *val, struct kernel_param *kp)
 {
-       printk(KERN_INFO __stringify(KBUILD_MODNAME)
+       printk(KERN_INFO KBUILD_MODNAME
               ": kernel >= 2.6.10 only uses 'ports' for conntrack modules\n");
        return 0;
 }
 module_param_call(ports, warn_set, NULL, NULL, 0);
 
-module_init(init);
-module_exit(fini);
+module_init(ip_nat_irc_init);
+module_exit(ip_nat_irc_fini);