drm/nv50: use alternate source of SOR_MODE_CTRL for DP hack
[safe/jmp/linux-2.6] / net / ipv4 / xfrm4_input.c
index 33f990d..c791bb6 100644 (file)
@@ -9,6 +9,7 @@
  *
  */
 
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/netfilter.h>
@@ -23,7 +24,7 @@ int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb)
 
 static inline int xfrm4_rcv_encap_finish(struct sk_buff *skb)
 {
-       if (skb->dst == NULL) {
+       if (skb_dst(skb) == NULL) {
                const struct iphdr *iph = ip_hdr(skb);
 
                if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
@@ -51,7 +52,11 @@ int xfrm4_transport_finish(struct sk_buff *skb, int async)
 
        iph->protocol = XFRM_MODE_SKB_CB(skb)->protocol;
 
-#ifdef CONFIG_NETFILTER
+#ifndef CONFIG_NETFILTER
+       if (!async)
+               return -iph->protocol;
+#endif
+
        __skb_push(skb, skb->data - skb_network_header(skb));
        iph->tot_len = htons(skb->len);
        ip_send_check(iph);
@@ -59,12 +64,6 @@ int xfrm4_transport_finish(struct sk_buff *skb, int async)
        NF_HOOK(PF_INET, NF_INET_PRE_ROUTING, skb, skb->dev, NULL,
                xfrm4_rcv_encap_finish);
        return 0;
-#else
-       if (async)
-               return xfrm4_rcv_encap_finish(skb);
-
-       return -iph->protocol;
-#endif
 }
 
 /* If it's a keepalive packet, then just eat it.
@@ -80,7 +79,6 @@ int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
        struct udphdr *uh;
        struct iphdr *iph;
        int iphlen, len;
-       int ret;
 
        __u8 *udpdata;
        __be32 *udpdata32;
@@ -154,8 +152,7 @@ int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
        skb_reset_transport_header(skb);
 
        /* process ESP */
-       ret = xfrm4_rcv_encap(skb, IPPROTO_ESP, 0, encap_type);
-       return ret;
+       return xfrm4_rcv_encap(skb, IPPROTO_ESP, 0, encap_type);
 
 drop:
        kfree_skb(skb);