aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2013-05-27 19:48:15 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-31 20:19:05 -0400
commitbf3d6a8f791b2a81279b9ce3201b4970f6fbe51a (patch)
tree72093c081b2de664ca77da0bc56fcaebf19eb195
parent35d0461061f27eeb62de63174959edbbb9e434de (diff)
iptunnel: specify protocol outside IP header
Before this patch, ip_tunnel_xmit() was using the field protocol from the IP header passed into argument. There is no functional change, this patch prepares the support of IPv4 over IPv4 for module sit. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/ip_tunnels.h2
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_tunnel.c4
-rw-r--r--net/ipv4/ipip.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 4b6f0b28f41f..40b4dfce01fc 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -101,7 +101,7 @@ int __net_init ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
101void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn); 101void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn);
102 102
103void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, 103void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
104 const struct iphdr *tnl_params); 104 const struct iphdr *tnl_params, const u8 protocol);
105int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd); 105int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
106int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu); 106int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
107 107
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 2a83591492dd..a982657d05e7 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -429,7 +429,7 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev,
429 return; 429 return;
430 } 430 }
431 431
432 ip_tunnel_xmit(skb, dev, tnl_params); 432 ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol);
433} 433}
434 434
435static netdev_tx_t ipgre_xmit(struct sk_buff *skb, 435static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index e4147ec1665a..b89095c1518f 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -487,7 +487,7 @@ drop:
487EXPORT_SYMBOL_GPL(ip_tunnel_rcv); 487EXPORT_SYMBOL_GPL(ip_tunnel_rcv);
488 488
489void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, 489void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
490 const struct iphdr *tnl_params) 490 const struct iphdr *tnl_params, const u8 protocol)
491{ 491{
492 struct ip_tunnel *tunnel = netdev_priv(dev); 492 struct ip_tunnel *tunnel = netdev_priv(dev);
493 const struct iphdr *inner_iph; 493 const struct iphdr *inner_iph;
@@ -670,7 +670,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
670 iph->version = 4; 670 iph->version = 4;
671 iph->ihl = sizeof(struct iphdr) >> 2; 671 iph->ihl = sizeof(struct iphdr) >> 2;
672 iph->frag_off = df; 672 iph->frag_off = df;
673 iph->protocol = tnl_params->protocol; 673 iph->protocol = protocol;
674 iph->tos = ip_tunnel_ecn_encap(tos, inner_iph, skb); 674 iph->tos = ip_tunnel_ecn_encap(tos, inner_iph, skb);
675 iph->daddr = fl4.daddr; 675 iph->daddr = fl4.daddr;
676 iph->saddr = fl4.saddr; 676 iph->saddr = fl4.saddr;
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 77bfcce64fe5..9df7ecd393f2 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -222,7 +222,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
222 skb->encapsulation = 1; 222 skb->encapsulation = 1;
223 } 223 }
224 224
225 ip_tunnel_xmit(skb, dev, tiph); 225 ip_tunnel_xmit(skb, dev, tiph, tiph->protocol);
226 return NETDEV_TX_OK; 226 return NETDEV_TX_OK;
227 227
228tx_error: 228tx_error: