]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/xfrm6_policy.c
netdevice hdlc: Convert directly reference of netdev->priv
[linux-2.6-omap-h63xx.git] / net / ipv6 / xfrm6_policy.c
index 08e4cbbe3f04e5f64e6d91f8b7864c8108d5e0ef..3b67ce7786ecba68e0c46168aa1510e78abe56ae 100644 (file)
@@ -144,6 +144,7 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev)
 static inline void
 _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
 {
+       int onlyproto = 0;
        u16 offset = skb_network_header_len(skb);
        struct ipv6hdr *hdr = ipv6_hdr(skb);
        struct ipv6_opt_hdr *exthdr;
@@ -159,6 +160,8 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
                exthdr = (struct ipv6_opt_hdr *)(nh + offset);
 
                switch (nexthdr) {
+               case NEXTHDR_FRAGMENT:
+                       onlyproto = 1;
                case NEXTHDR_ROUTING:
                case NEXTHDR_HOP:
                case NEXTHDR_DEST:
@@ -172,7 +175,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
                case IPPROTO_TCP:
                case IPPROTO_SCTP:
                case IPPROTO_DCCP:
-                       if (pskb_may_pull(skb, nh + offset + 4 - skb->data)) {
+                       if (!onlyproto && pskb_may_pull(skb, nh + offset + 4 - skb->data)) {
                                __be16 *ports = (__be16 *)exthdr;
 
                                fl->fl_ip_sport = ports[!!reverse];
@@ -182,7 +185,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
                        return;
 
                case IPPROTO_ICMPV6:
-                       if (pskb_may_pull(skb, nh + offset + 2 - skb->data)) {
+                       if (!onlyproto && pskb_may_pull(skb, nh + offset + 2 - skb->data)) {
                                u8 *icmp = (u8 *)exthdr;
 
                                fl->fl_icmp_type = icmp[0];
@@ -193,7 +196,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
 
 #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
                case IPPROTO_MH:
-                       if (pskb_may_pull(skb, nh + offset + 3 - skb->data)) {
+                       if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) {
                                struct ip6_mh *mh;
                                mh = (struct ip6_mh *)exthdr;
 
@@ -274,7 +277,6 @@ static struct dst_ops xfrm6_dst_ops = {
        .ifdown =               xfrm6_dst_ifdown,
        .local_out =            __ip6_local_out,
        .gc_thresh =            1024,
-       .entry_size =           sizeof(struct xfrm_dst),
        .entries =              ATOMIC_INIT(0),
 };