aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2013-03-09 11:38:39 -0500
committerDavid S. Miller <davem@davemloft.net>2013-03-10 03:05:44 -0400
commit6aed0c8bf7d2f389b472834053eb6e3bd6926999 (patch)
tree0b180bcbbefd6e6e447b8771d50fe5371b75bd29 /net/ipv4/ipip.c
parent4f3ed9209f7f75ff0ee21bc5052d76542dd75b5f (diff)
tunnel: use iptunnel_xmit() again
With recent patches from Pravin, most tunnels can't use iptunnel_xmit() any more, due to ip_select_ident() and skb->ip_summed. But we can just move these operations out of iptunnel_xmit(), so that tunnels can use it again. This by the way fixes a bug in vxlan (missing nf_reset()) for net-next. Cc: Pravin B Shelar <pshelar@nicira.com> Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index b50435ba0ce5..34e006fe2d87 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -478,8 +478,6 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
478 __be32 dst = tiph->daddr; 478 __be32 dst = tiph->daddr;
479 struct flowi4 fl4; 479 struct flowi4 fl4;
480 int mtu; 480 int mtu;
481 int err;
482 int pkt_len;
483 481
484 if (skb->protocol != htons(ETH_P_IP)) 482 if (skb->protocol != htons(ETH_P_IP))
485 goto tx_error; 483 goto tx_error;
@@ -600,21 +598,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
600 if ((iph->ttl = tiph->ttl) == 0) 598 if ((iph->ttl = tiph->ttl) == 0)
601 iph->ttl = old_iph->ttl; 599 iph->ttl = old_iph->ttl;
602 600
603 nf_reset(skb); 601 iptunnel_xmit(skb, dev);
604
605 pkt_len = skb->len - skb_transport_offset(skb);
606 err = ip_local_out(skb);
607 if (likely(net_xmit_eval(err) == 0)) {
608 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
609
610 u64_stats_update_begin(&tstats->syncp);
611 tstats->tx_bytes += pkt_len;
612 tstats->tx_packets++;
613 u64_stats_update_end(&tstats->syncp);
614 } else {
615 dev->stats.tx_errors++;
616 dev->stats.tx_aborted_errors++;
617 }
618 602
619 return NETDEV_TX_OK; 603 return NETDEV_TX_OK;
620 604