summaryrefslogtreecommitdiff
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-08-05 06:42:01 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2011-08-05 06:42:01 -1000
commit07d952dc669bb70a9716a81e140e89b7d4969f09 (patch)
tree6e6455adcfdbd689e98e417401d692784de8ff92 /net/ipv6/ip6_output.c
parent5fdb32472ec6cd1d62788d8872585b342b5d1d92 (diff)
parentc15fea2d8ca834dae491339c47e4fb3c81428190 (diff)
downloadlinux-3.10-07d952dc669bb70a9716a81e140e89b7d4969f09.tar.gz
linux-3.10-07d952dc669bb70a9716a81e140e89b7d4969f09.tar.bz2
linux-3.10-07d952dc669bb70a9716a81e140e89b7d4969f09.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (54 commits) ipv6: check for IPv4 mapped addresses when connecting IPv6 sockets mlx4: decreasing ref count when removing mac net: Fix security_socket_sendmsg() bypass problem. net: Cap number of elements for sendmmsg net: sendmmsg should only return an error if no messages were sent ixgbe: fix PHY link setup for 82599 ixgbe: fix __ixgbe_notify_dca() bail out code igb: fix WOL on second port of i350 device e1000e: minor re-order of #include files e1000e: remove unnecessary check for NULL pointer intel drivers: repair missing flush operations macb: restore wrap bit when performing underrun cleanup cdc_ncm: fix endianness problem. irda: use PCI_VENDOR_ID_* mlx4: Fixing Ethernet unicast packet steering net: fix NULL dereferences in check_peer_redir() bnx2x: Clear MDIO access warning during first driver load bnx2x: Fix BCM578xx MAC test bnx2x: Fix BCM54618se invalid link indication bnx2x: Fix BCM84833 link ...
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 32e5339db0c..4c882cf4e8a 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -135,10 +135,15 @@ static int ip6_finish_output2(struct sk_buff *skb)
skb->len);
}
+ rcu_read_lock();
neigh = dst_get_neighbour(dst);
- if (neigh)
- return neigh_output(neigh, skb);
+ if (neigh) {
+ int res = neigh_output(neigh, skb);
+ rcu_read_unlock();
+ return res;
+ }
+ rcu_read_unlock();
IP6_INC_STATS_BH(dev_net(dst->dev),
ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
kfree_skb(skb);
@@ -975,12 +980,14 @@ static int ip6_dst_lookup_tail(struct sock *sk,
* dst entry and replace it instead with the
* dst entry of the nexthop router
*/
+ rcu_read_lock();
n = dst_get_neighbour(*dst);
if (n && !(n->nud_state & NUD_VALID)) {
struct inet6_ifaddr *ifp;
struct flowi6 fl_gw6;
int redirect;
+ rcu_read_unlock();
ifp = ipv6_get_ifaddr(net, &fl6->saddr,
(*dst)->dev, 1);
@@ -1000,6 +1007,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
if ((err = (*dst)->error))
goto out_err_release;
}
+ } else {
+ rcu_read_unlock();
}
#endif