From a9a4eb51d4130236e3d323a711138604d6159853 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 18 Oct 2007 05:14:58 -0700 Subject: [PATCH] --- yaml --- r: 71299 b: refs/heads/master c: 04028045a12ba941c579d0f3238489333ac18ea4 h: refs/heads/master i: 71297: 3b94f4c73a77a043d3e66a1e4d3655c1847b4e96 71295: c6f116d09a690d0eb2fb746ed8b07da862fdb83b v: v3 --- [refs] | 2 +- trunk/net/ipv6/ip6_flowlabel.c | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index c7c3ffe63dc9..2e7c3744df2a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 009e8c965fd72a78636b9a96c7015109c5c70176 +refs/heads/master: 04028045a12ba941c579d0f3238489333ac18ea4 diff --git a/trunk/net/ipv6/ip6_flowlabel.c b/trunk/net/ipv6/ip6_flowlabel.c index 217d60f9fc80..8550df20f984 100644 --- a/trunk/net/ipv6/ip6_flowlabel.c +++ b/trunk/net/ipv6/ip6_flowlabel.c @@ -409,6 +409,16 @@ static int ipv6_opt_cmp(struct ipv6_txoptions *o1, struct ipv6_txoptions *o2) return 0; } +static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl, + struct ip6_flowlabel *fl) +{ + write_lock_bh(&ip6_sk_fl_lock); + sfl->fl = fl; + sfl->next = np->ipv6_fl_list; + np->ipv6_fl_list = sfl; + write_unlock_bh(&ip6_sk_fl_lock); +} + int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen) { int err; @@ -513,11 +523,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen) fl1->linger = fl->linger; if ((long)(fl->expires - fl1->expires) > 0) fl1->expires = fl->expires; - write_lock_bh(&ip6_sk_fl_lock); - sfl1->fl = fl1; - sfl1->next = np->ipv6_fl_list; - np->ipv6_fl_list = sfl1; - write_unlock_bh(&ip6_sk_fl_lock); + fl_link(np, sfl1, fl1); fl_free(fl); return 0; @@ -545,9 +551,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen) } } - sfl1->fl = fl; - sfl1->next = np->ipv6_fl_list; - np->ipv6_fl_list = sfl1; + fl_link(np, sfl1, fl); return 0; default: