]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv6/ip6_flowlabel.c
ipv6: protect flow label renew against GC
[karo-tx-linux.git] / net / ipv6 / ip6_flowlabel.c
index 5f10b0d0bca518fd2a3d0666d05f07db7198de8b..98fdcc6f51b149d4f6019f25ab865f954c93d405 100644 (file)
@@ -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;
 }