Skip to content

Commit

Permalink
net: ipv6: add missing lock in ping_v6_sendmsg
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
lcolitti authored and davem330 committed Jul 4, 2013
1 parent 36b7bfe commit a1bdc45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv6/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (hlimit < 0)
hlimit = ip6_dst_hoplimit(dst);

lock_sock(sk);
err = ip6_append_data(sk, ping_getfrag, &pfh, len,
0, hlimit,
np->tclass, NULL, &fl6, rt,
Expand All @@ -188,6 +189,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
(struct icmp6hdr *) &pfh.icmph,
len);
}
release_sock(sk);

return err;
}
Expand Down

0 comments on commit a1bdc45

Please sign in to comment.