]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/icmp.c
[IPSEC]: Do not let packets pass when ICMP flag is off
[linux-2.6-omap-h63xx.git] / net / ipv4 / icmp.c
index c41f3cc4fba83bc901f44b24b8e432ce2dba7880..ce5b4be559aa74fcc287405f7eb6e9417eec0977 100644 (file)
@@ -977,10 +977,13 @@ int icmp_rcv(struct sk_buff *skb)
        struct icmphdr *icmph;
        struct rtable *rt = (struct rtable *)skb->dst;
 
-       if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb) && skb->sp &&
-           skb->sp->xvec[skb->sp->len - 1]->props.flags & XFRM_STATE_ICMP) {
+       if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
                int nh;
 
+               if (!(skb->sp && skb->sp->xvec[skb->sp->len - 1]->props.flags &
+                                XFRM_STATE_ICMP))
+                       goto drop;
+
                if (!pskb_may_pull(skb, sizeof(*icmph) + sizeof(struct iphdr)))
                        goto drop;