]> err.no Git - linux-2.6/blobdiff - net/ipv4/ipvs/ip_vs_ctl.c
[NETFILTER]: CLUSTERIP: fix memcpy() length typo
[linux-2.6] / net / ipv4 / ipvs / ip_vs_ctl.c
index 12a82e91d22ac4d31cfd62143d1b9aa7e1cdbab2..2d66848e7aa06bb75df50aad715d6c45837535e7 100644 (file)
@@ -90,7 +90,8 @@ int ip_vs_get_debug_level(void)
 #endif
 
 /*
- *     update_defense_level is called from keventd and from sysctl.
+ *     update_defense_level is called from keventd and from sysctl,
+ *     so it needs to protect itself from softirqs
  */
 static void update_defense_level(void)
 {
@@ -110,6 +111,8 @@ static void update_defense_level(void)
 
        nomem = (availmem < sysctl_ip_vs_amemthresh);
 
+       local_bh_disable();
+
        /* drop_entry */
        spin_lock(&__ip_vs_dropentry_lock);
        switch (sysctl_ip_vs_drop_entry) {
@@ -206,6 +209,8 @@ static void update_defense_level(void)
        if (to_change >= 0)
                ip_vs_protocol_timeout_change(sysctl_ip_vs_secure_tcp>1);
        write_unlock(&__ip_vs_securetcp_lock);
+
+       local_bh_enable();
 }
 
 
@@ -1360,9 +1365,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
                        /* Restore the correct value */
                        *valp = val;
                } else {
-                       local_bh_disable();
                        update_defense_level();
-                       local_bh_enable();
                }
        }
        return rc;
@@ -1595,7 +1598,7 @@ static ctl_table vs_table[] = {
        { .ctl_name = 0 }
 };
 
-static ctl_table ipv4_table[] = {
+static ctl_table ipvs_ipv4_table[] = {
        {
                .ctl_name       = NET_IPV4,
                .procname       = "ipv4",
@@ -1610,7 +1613,7 @@ static ctl_table vs_root_table[] = {
                .ctl_name       = CTL_NET,
                .procname       = "net",
                .mode           = 0555,
-               .child          = ipv4_table,
+               .child          = ipvs_ipv4_table,
        },
        { .ctl_name = 0 }
 };