From 7c086a7345f5561ce95dcd16f443efbddf81f514 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Fri, 28 Apr 2006 15:59:15 -0700 Subject: [PATCH] --- yaml --- r: 26377 b: refs/heads/master c: c302e6d54e468ee9b1e18152e2e9da06953f3473 h: refs/heads/master i: 26375: 21fa3e20adb2b0815b58e6ae649c138c4ccb1afa v: v3 --- [refs] | 2 +- trunk/net/ipv6/route.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index ea2aa9c7a6de..6fd18e691c65 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e959d8121fcbfee6ec049cc617e9423d1799f2e4 +refs/heads/master: c302e6d54e468ee9b1e18152e2e9da06953f3473 diff --git a/trunk/net/ipv6/route.c b/trunk/net/ipv6/route.c index 79078747a646..0190e39096b9 100644 --- a/trunk/net/ipv6/route.c +++ b/trunk/net/ipv6/route.c @@ -317,7 +317,7 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif, __FUNCTION__, head, head ? *head : NULL, oif); for (rt = rt0, metric = rt0->rt6i_metric; - rt && rt->rt6i_metric == metric; + rt && rt->rt6i_metric == metric && (!last || rt != rt0); rt = rt->u.next) { int m; @@ -343,9 +343,12 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif, (strict & RT6_SELECT_F_REACHABLE) && last && last != rt0) { /* no entries matched; do round-robin */ + static spinlock_t lock = SPIN_LOCK_UNLOCKED; + spin_lock(&lock); *head = rt0->u.next; rt0->u.next = last->u.next; last->u.next = rt0; + spin_unlock(&lock); } RT6_TRACE("%s() => %p, score=%d\n",