This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / net / ipv6 / ip6_output.c
index ed31c53..020b3f5 100644 (file)
@@ -56,7 +56,7 @@
 #include <net/xfrm.h>
 #include <net/checksum.h>
 
-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
+static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**));
 
 static __inline__ void ipv6_select_ident(struct sk_buff *skb, struct frag_hdr *fhdr)
 {
@@ -108,8 +108,9 @@ static int ip6_dev_loopback_xmit(struct sk_buff *newskb)
 }
 
 
-static int ip6_output2(struct sk_buff *skb)
+static int ip6_output2(struct sk_buff **pskb)
 {
+       struct sk_buff *skb = *pskb;
        struct dst_entry *dst = skb->dst;
        struct net_device *dev = dst->dev;
 
@@ -145,12 +146,14 @@ static int ip6_output2(struct sk_buff *skb)
        return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
 }
 
-int ip6_output(struct sk_buff *skb)
+int ip6_output(struct sk_buff **pskb)
 {
+       struct sk_buff *skb = *pskb;
+
        if (skb->len > dst_pmtu(skb->dst))
-               return ip6_fragment(skb, ip6_output2);
+               return ip6_fragment(pskb, ip6_output2);
        else
-               return ip6_output2(skb);
+               return ip6_output2(pskb);
 }
 
 #ifdef CONFIG_NETFILTER
@@ -515,10 +518,10 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
        return offset;
 }
 
-static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
+static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
 {
        struct net_device *dev;
-       struct sk_buff *frag;
+       struct sk_buff *frag, *skb = *pskb;
        struct rt6_info *rt = (struct rt6_info*)skb->dst;
        struct ipv6hdr *tmp_hdr;
        struct frag_hdr *fh;
@@ -607,7 +610,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
                                ip6_copy_metadata(frag, skb);
                        }
                        
-                       err = output(skb);
+                       err = output(&skb);
                        if (err || !frag)
                                break;
 
@@ -723,7 +726,7 @@ slow_path:
 
                IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
 
-               err = output(frag);
+               err = output(&frag);
                if (err)
                        goto fail;
        }
@@ -745,7 +748,7 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
        if (sk) {
                struct ipv6_pinfo *np = inet6_sk(sk);
        
-               *dst = sk_dst_check(sk, np->dst_cookie);
+               *dst = __sk_dst_check(sk, np->dst_cookie);
                if (*dst) {
                        struct rt6_info *rt = (struct rt6_info*)*dst;
        
@@ -768,13 +771,13 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)
                                 */
        
                        if (((rt->rt6i_dst.plen != 128 ||
-                             !ipv6_addr_equal(&fl->fl6_dst, &rt->rt6i_dst.addr))
+                             ipv6_addr_cmp(&fl->fl6_dst, &rt->rt6i_dst.addr))
                             && (np->daddr_cache == NULL ||
-                                !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache)))
+                                ipv6_addr_cmp(&fl->fl6_dst, np->daddr_cache)))
                            || (fl->oif && fl->oif != (*dst)->dev->ifindex)) {
-                               dst_release(*dst);
                                *dst = NULL;
-                       }
+                       } else
+                               dst_hold(*dst);
                }
        }