net: add a noref bit on skb dst
[pandora-kernel.git] / net / ipv4 / ip_options.c
index 4c09a31..3244133 100644 (file)
@@ -601,6 +601,7 @@ int ip_options_rcv_srr(struct sk_buff *skb)
        unsigned char *optptr = skb_network_header(skb) + opt->srr;
        struct rtable *rt = skb_rtable(skb);
        struct rtable *rt2;
+       unsigned long orefdst;
        int err;
 
        if (!opt->srr)
@@ -624,16 +625,16 @@ int ip_options_rcv_srr(struct sk_buff *skb)
                }
                memcpy(&nexthop, &optptr[srrptr-1], 4);
 
-               rt = skb_rtable(skb);
+               orefdst = skb->_skb_refdst;
                skb_dst_set(skb, NULL);
                err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, skb->dev);
                rt2 = skb_rtable(skb);
                if (err || (rt2->rt_type != RTN_UNICAST && rt2->rt_type != RTN_LOCAL)) {
-                       ip_rt_put(rt2);
-                       skb_dst_set(skb, &rt->u.dst);
+                       skb_dst_drop(skb);
+                       skb->_skb_refdst = orefdst;
                        return -EINVAL;
                }
-               ip_rt_put(rt);
+               refdst_drop(orefdst);
                if (rt2->rt_type != RTN_LOCAL)
                        break;
                /* Superfast 8) loopback forward */