diff options
| -rw-r--r-- | include/net/ip6_tunnel.h | 9 | ||||
| -rw-r--r-- | net/ipv4/ip_tunnel_core.c | 9 | ||||
| -rw-r--r-- | net/tipc/udp_media.c | 8 |
3 files changed, 15 insertions, 11 deletions
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 69b4bcf880c9..028eaea1c854 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
| @@ -158,9 +158,12 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb, | |||
| 158 | memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); | 158 | memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); |
| 159 | pkt_len = skb->len - skb_inner_network_offset(skb); | 159 | pkt_len = skb->len - skb_inner_network_offset(skb); |
| 160 | err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb); | 160 | err = ip6_local_out(dev_net(skb_dst(skb)->dev), sk, skb); |
| 161 | if (unlikely(net_xmit_eval(err))) | 161 | |
| 162 | pkt_len = -1; | 162 | if (dev) { |
| 163 | iptunnel_xmit_stats(dev, pkt_len); | 163 | if (unlikely(net_xmit_eval(err))) |
| 164 | pkt_len = -1; | ||
| 165 | iptunnel_xmit_stats(dev, pkt_len); | ||
| 166 | } | ||
| 164 | } | 167 | } |
| 165 | #endif | 168 | #endif |
| 166 | #endif | 169 | #endif |
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index 9e3846388fb3..1452a97914a0 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c | |||
| @@ -76,9 +76,12 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb, | |||
| 76 | __ip_select_ident(net, iph, skb_shinfo(skb)->gso_segs ?: 1); | 76 | __ip_select_ident(net, iph, skb_shinfo(skb)->gso_segs ?: 1); |
| 77 | 77 | ||
| 78 | err = ip_local_out(net, sk, skb); | 78 | err = ip_local_out(net, sk, skb); |
| 79 | if (unlikely(net_xmit_eval(err))) | 79 | |
| 80 | pkt_len = 0; | 80 | if (dev) { |
| 81 | iptunnel_xmit_stats(dev, pkt_len); | 81 | if (unlikely(net_xmit_eval(err))) |
| 82 | pkt_len = 0; | ||
| 83 | iptunnel_xmit_stats(dev, pkt_len); | ||
| 84 | } | ||
| 82 | } | 85 | } |
| 83 | EXPORT_SYMBOL_GPL(iptunnel_xmit); | 86 | EXPORT_SYMBOL_GPL(iptunnel_xmit); |
| 84 | 87 | ||
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index 7fc02d84c4f1..1405ccc9101c 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c | |||
| @@ -176,7 +176,6 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb, | |||
| 176 | goto tx_error; | 176 | goto tx_error; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | skb->dev = rt->dst.dev; | ||
| 180 | ttl = ip4_dst_hoplimit(&rt->dst); | 179 | ttl = ip4_dst_hoplimit(&rt->dst); |
| 181 | udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, | 180 | udp_tunnel_xmit_skb(rt, ub->ubsock->sk, skb, src->ipv4.s_addr, |
| 182 | dst->ipv4.s_addr, 0, ttl, 0, src->port, | 181 | dst->ipv4.s_addr, 0, ttl, 0, src->port, |
| @@ -195,10 +194,9 @@ static int tipc_udp_xmit(struct net *net, struct sk_buff *skb, | |||
| 195 | if (err) | 194 | if (err) |
| 196 | goto tx_error; | 195 | goto tx_error; |
| 197 | ttl = ip6_dst_hoplimit(ndst); | 196 | ttl = ip6_dst_hoplimit(ndst); |
| 198 | err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, | 197 | err = udp_tunnel6_xmit_skb(ndst, ub->ubsock->sk, skb, NULL, |
| 199 | ndst->dev, &src->ipv6, | 198 | &src->ipv6, &dst->ipv6, 0, ttl, 0, |
| 200 | &dst->ipv6, 0, ttl, 0, src->port, | 199 | src->port, dst->port, false); |
| 201 | dst->port, false); | ||
| 202 | #endif | 200 | #endif |
| 203 | } | 201 | } |
| 204 | return err; | 202 | return err; |
