From 23c50109c30ba20795767aa3828665472daf2c4f Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 12 Oct 2003 22:21:36 -0700 Subject: [PATCH] [IPIP]: Decapsulate after checking policy. --- net/ipv4/ipip.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 6f69aa521ffdf..027b474c1c769 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -475,11 +475,6 @@ static int ipip_rcv(struct sk_buff *skb) goto out; iph = skb->nh.iph; - skb->mac.raw = skb->nh.raw; - skb->nh.raw = skb->data; - memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); - skb->protocol = htons(ETH_P_IP); - skb->pkt_type = PACKET_HOST; read_lock(&ipip_lock); if ((tunnel = ipip_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { @@ -488,6 +483,12 @@ static int ipip_rcv(struct sk_buff *skb) return 0; } + skb->mac.raw = skb->nh.raw; + skb->nh.raw = skb->data; + memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); + skb->protocol = htons(ETH_P_IP); + skb->pkt_type = PACKET_HOST; + tunnel->stat.rx_packets++; tunnel->stat.rx_bytes += skb->len; skb->dev = tunnel->dev; -- 2.53.0