diff options
author | Pravin B Shelar <pshelar@nicira.com> | 2013-06-17 17:50:02 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-19 18:07:41 -0700 |
commit | 3d7b46cd20e300bd6989fb1f43d46f1b9645816e (patch) | |
tree | b8a063f8ecb7e380f0e1672a60815ff48c3f9b56 /net/ipv4/ipip.c | |
parent | 0e6fbc5b6c6218987c93b8c7ca60cf786062899d (diff) | |
download | op-kernel-dev-3d7b46cd20e300bd6989fb1f43d46f1b9645816e.zip op-kernel-dev-3d7b46cd20e300bd6989fb1f43d46f1b9645816e.tar.gz |
ip_tunnel: push generic protocol handling to ip_tunnel module.
Process skb tunnel header before sending packet to protocol handler.
this allows code sharing between gre and ovs gre modules.
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 9df7ecd..e6905fb 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -188,8 +188,12 @@ static int ipip_rcv(struct sk_buff *skb) struct net *net = dev_net(skb->dev); struct ip_tunnel_net *itn = net_generic(net, ipip_net_id); struct ip_tunnel *tunnel; - const struct iphdr *iph = ip_hdr(skb); + const struct iphdr *iph; + if (iptunnel_pull_header(skb, 0, tpi.proto)) + goto drop; + + iph = ip_hdr(skb); tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY, iph->saddr, iph->daddr, 0); if (tunnel) { |