]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/tcp_cong.c
[PATCH] ext4 balloc: fix off-by-one against grp_goal
[linux-2.6-omap-h63xx.git] / net / ipv4 / tcp_cong.c
index 343d6197c92e95f0660cfc6853bda4e58435bc7a..5ca7723d07987a604bb6382f0fdefc3f1850b2cb 100644 (file)
@@ -113,7 +113,7 @@ int tcp_set_default_congestion_control(const char *name)
        spin_lock(&tcp_cong_list_lock);
        ca = tcp_ca_find(name);
 #ifdef CONFIG_KMOD
-       if (!ca) {
+       if (!ca && capable(CAP_SYS_MODULE)) {
                spin_unlock(&tcp_cong_list_lock);
 
                request_module("tcp_%s", name);
@@ -236,9 +236,19 @@ int tcp_set_congestion_control(struct sock *sk, const char *name)
 
        rcu_read_lock();
        ca = tcp_ca_find(name);
+       /* no change asking for existing value */
        if (ca == icsk->icsk_ca_ops)
                goto out;
 
+#ifdef CONFIG_KMOD
+       /* not found attempt to autoload module */
+       if (!ca && capable(CAP_SYS_MODULE)) {
+               rcu_read_unlock();
+               request_module("tcp_%s", name);
+               rcu_read_lock();
+               ca = tcp_ca_find(name);
+       }
+#endif
        if (!ca)
                err = -ENOENT;