]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv6/ip6_flowlabel.c
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
[karo-tx-linux.git] / net / ipv6 / ip6_flowlabel.c
index 4a06ed01d0c313e74d9bb8d78b480757bbdb4f20..e7fb7106550f1d0c45bfa59b341681175be588b2 100644 (file)
@@ -41,7 +41,7 @@
 #define FL_MIN_LINGER  6       /* Minimal linger. It is set to 6sec specified
                                   in old IPv6 RFC. Well, it was reasonable value.
                                 */
-#define FL_MAX_LINGER  60      /* Maximal linger timeout */
+#define FL_MAX_LINGER  150     /* Maximal linger timeout */
 
 /* FL hash table */
 
@@ -345,6 +345,8 @@ static int fl6_renew(struct ip6_flowlabel *fl, unsigned long linger, unsigned lo
        expires = check_linger(expires);
        if (!expires)
                return -EPERM;
+
+       spin_lock_bh(&ip6_fl_lock);
        fl->lastuse = jiffies;
        if (time_before(fl->linger, linger))
                fl->linger = linger;
@@ -352,6 +354,8 @@ static int fl6_renew(struct ip6_flowlabel *fl, unsigned long linger, unsigned lo
                expires = fl->linger;
        if (time_before(fl->expires, fl->lastuse + expires))
                fl->expires = fl->lastuse + expires;
+       spin_unlock_bh(&ip6_fl_lock);
+
        return 0;
 }
 
@@ -453,8 +457,10 @@ static int mem_check(struct sock *sk)
        if (room > FL_MAX_SIZE - FL_MAX_PER_SOCK)
                return 0;
 
+       rcu_read_lock_bh();
        for_each_sk_fl_rcu(np, sfl)
                count++;
+       rcu_read_unlock_bh();
 
        if (room <= 0 ||
            ((count >= FL_MAX_PER_SOCK ||