diff options
author | Eric Dumazet <edumazet@google.com> | 2012-08-10 04:22:47 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-10 23:08:57 +0200 |
commit | b5ec8eeac46a99004c26791f70b15d001e970acf (patch) | |
tree | 8609d6c3e5e9504e6f084828b9b0f8a9084652e3 /net/ipv4/udp.c | |
parent | net: tcp: ipv6_mapped needs sk_rx_dst_set method (diff) | |
download | linux-b5ec8eeac46a99004c26791f70b15d001e970acf.tar.xz linux-b5ec8eeac46a99004c26791f70b15d001e970acf.zip |
ipv4: fix ip_send_skb()
ip_send_skb() can send orphaned skb, so we must pass the net pointer to
avoid possible NULL dereference in error path.
Bug added by commit 3a7c384ffd57 (ipv4: tcp: unicast_sock should not
land outside of TCP stack)
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/ipv4/udp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index b4c3582a991f..6f6d1aca3c3d 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -758,7 +758,7 @@ static int udp_send_skb(struct sk_buff *skb, struct flowi4 *fl4) uh->check = CSUM_MANGLED_0; send: - err = ip_send_skb(skb); + err = ip_send_skb(sock_net(sk), skb); if (err) { if (err == -ENOBUFS && !inet->recverr) { UDP_INC_STATS_USER(sock_net(sk), |