aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2012-09-11 17:59:01 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-13 16:53:46 -0400
commit5744dd9b71c6b9df944c6a32a000d4a564a2abd7 (patch)
tree5d40eb61a4152f32fa15afdfded741648cfc28c7 /net/ipv6/addrconf.c
parentfb0af4c74f200e3c4846d91d8f2f8b265450bba7 (diff)
ipv6: replace write lock with read lock when get route info
geting route info does not write rt->rt6i_table, so replace write lock with read lock Suggested-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 5fd8ec895c8b..719a828fb67f 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1708,7 +1708,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
1708 if (table == NULL) 1708 if (table == NULL)
1709 return NULL; 1709 return NULL;
1710 1710
1711 write_lock_bh(&table->tb6_lock); 1711 read_lock_bh(&table->tb6_lock);
1712 fn = fib6_locate(&table->tb6_root, pfx, plen, NULL, 0); 1712 fn = fib6_locate(&table->tb6_root, pfx, plen, NULL, 0);
1713 if (!fn) 1713 if (!fn)
1714 goto out; 1714 goto out;
@@ -1723,7 +1723,7 @@ static struct rt6_info *addrconf_get_prefix_route(const struct in6_addr *pfx,
1723 break; 1723 break;
1724 } 1724 }
1725out: 1725out:
1726 write_unlock_bh(&table->tb6_lock); 1726 read_unlock_bh(&table->tb6_lock);
1727 return rt; 1727 return rt;
1728} 1728}
1729 1729