diff options
| author | Richard Alpe <richard.alpe@ericsson.com> | 2016-03-03 08:20:40 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-03-06 22:54:56 -0500 |
| commit | 9b3009604b8e305c32125530a3cbcc57d88f3bc1 (patch) | |
| tree | d5c275e3324846d9ff7ca120150c521c6d786feb /net/tipc | |
| parent | 962d8cdc3133435aed2928637f73e272128a326c (diff) | |
tipc: add net device to skb before UDP xmit
Prior to this patch enabling a IPv4 UDP bearer caused a null pointer
dereference in iptunnel_xmit_stats(), when it tried to dereference the
net device from the skb. To resolve this we now point the skb device
to the net device resolved from the routing table.
Fixes: 039f50629b7f (ip_tunnel: Move stats update to iptunnel_xmit())
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
| -rw-r--r-- | net/tipc/udp_media.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index d63a911e7fe2..f22a5bb169c9 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c | |||
| @@ -181,6 +181,8 @@ static int tipc_udp_send_msg(struct net *net, struct sk_buff *skb, | |||
| 181 | err = PTR_ERR(rt); | 181 | err = PTR_ERR(rt); |
| 182 | goto tx_error; | 182 | goto tx_error; |
| 183 | } | 183 | } |
| 184 | |||
| 185 | skb->dev = rt->dst.dev; | ||
| 184 | ttl = ip4_dst_hoplimit(&rt->dst); | 186 | ttl = ip4_dst_hoplimit(&rt->dst); |
| 185 | udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, | 187 | udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, |
| 186 | dst->ipv4.s_addr, 0, ttl, 0, src->udp_port, | 188 | dst->ipv4.s_addr, 0, ttl, 0, src->udp_port, |
