Commit bf3d6a8f authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

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: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 35d04610
...@@ -101,7 +101,7 @@ int __net_init ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, ...@@ -101,7 +101,7 @@ int __net_init ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn); void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn);
void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
const struct iphdr *tnl_params); const struct iphdr *tnl_params, const u8 protocol);
int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd); int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu); int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
......
...@@ -429,7 +429,7 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -429,7 +429,7 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev,
return; return;
} }
ip_tunnel_xmit(skb, dev, tnl_params); ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol);
} }
static netdev_tx_t ipgre_xmit(struct sk_buff *skb, static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
......
...@@ -487,7 +487,7 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb, ...@@ -487,7 +487,7 @@ int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
EXPORT_SYMBOL_GPL(ip_tunnel_rcv); EXPORT_SYMBOL_GPL(ip_tunnel_rcv);
void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
const struct iphdr *tnl_params) const struct iphdr *tnl_params, const u8 protocol)
{ {
struct ip_tunnel *tunnel = netdev_priv(dev); struct ip_tunnel *tunnel = netdev_priv(dev);
const struct iphdr *inner_iph; const struct iphdr *inner_iph;
...@@ -670,7 +670,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -670,7 +670,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
iph->version = 4; iph->version = 4;
iph->ihl = sizeof(struct iphdr) >> 2; iph->ihl = sizeof(struct iphdr) >> 2;
iph->frag_off = df; iph->frag_off = df;
iph->protocol = tnl_params->protocol; iph->protocol = protocol;
iph->tos = ip_tunnel_ecn_encap(tos, inner_iph, skb); iph->tos = ip_tunnel_ecn_encap(tos, inner_iph, skb);
iph->daddr = fl4.daddr; iph->daddr = fl4.daddr;
iph->saddr = fl4.saddr; iph->saddr = fl4.saddr;
......
...@@ -222,7 +222,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -222,7 +222,7 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
skb->encapsulation = 1; skb->encapsulation = 1;
} }
ip_tunnel_xmit(skb, dev, tiph); ip_tunnel_xmit(skb, dev, tiph, tiph->protocol);
return NETDEV_TX_OK; return NETDEV_TX_OK;
tx_error: tx_error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment