]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/ipip.c
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville...
[net-next-2.6.git] / net / ipv4 / ipip.c
index 9054139795af480757357dc626815296666f8919..08ccd344de7a9a88d9f5236bb319bab86819e544 100644 (file)
@@ -370,8 +370,7 @@ static int ipip_rcv(struct sk_buff *skb)
                tunnel->dev->stats.rx_packets++;
                tunnel->dev->stats.rx_bytes += skb->len;
                skb->dev = tunnel->dev;
-               dst_release(skb->dst);
-               skb->dst = NULL;
+               skb_dst_drop(skb);
                nf_reset(skb);
                ipip_ecn_decapsulate(iph, skb);
                netif_rx(skb);
@@ -388,7 +387,7 @@ static int ipip_rcv(struct sk_buff *skb)
  *     and that skb is filled properly by that function.
  */
 
-static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct ip_tunnel *tunnel = netdev_priv(dev);
        struct net_device_stats *stats = &tunnel->dev->stats;
@@ -403,11 +402,6 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        __be32 dst = tiph->daddr;
        int    mtu;
 
-       if (tunnel->recursion++) {
-               stats->collisions++;
-               goto tx_error;
-       }
-
        if (skb->protocol != htons(ETH_P_IP))
                goto tx_error;
 
@@ -416,7 +410,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (!dst) {
                /* NBMA tunnel */
-               if ((rt = skb->rtable) == NULL) {
+               if ((rt = skb_rtable(skb)) == NULL) {
                        stats->tx_fifo_errors++;
                        goto tx_error;
                }
@@ -447,15 +441,15 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        if (tiph->frag_off)
                mtu = dst_mtu(&rt->u.dst) - sizeof(struct iphdr);
        else
-               mtu = skb->dst ? dst_mtu(skb->dst) : dev->mtu;
+               mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
 
        if (mtu < 68) {
                stats->collisions++;
                ip_rt_put(rt);
                goto tx_error;
        }
-       if (skb->dst)
-               skb->dst->ops->update_pmtu(skb->dst, mtu);
+       if (skb_dst(skb))
+               skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu);
 
        df |= (old_iph->frag_off&htons(IP_DF));
 
@@ -486,8 +480,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
                        ip_rt_put(rt);
                        stats->tx_dropped++;
                        dev_kfree_skb(skb);
-                       tunnel->recursion--;
-                       return 0;
+                       return NETDEV_TX_OK;
                }
                if (skb->sk)
                        skb_set_owner_w(new_skb, skb->sk);
@@ -502,8 +495,8 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
        IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
                              IPSKB_REROUTED);
-       dst_release(skb->dst);
-       skb->dst = &rt->u.dst;
+       skb_dst_drop(skb);
+       skb_dst_set(skb, &rt->u.dst);
 
        /*
         *      Push down and install the IPIP header.
@@ -524,16 +517,14 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
        nf_reset(skb);
 
        IPTUNNEL_XMIT();
-       tunnel->recursion--;
-       return 0;
+       return NETDEV_TX_OK;
 
 tx_error_icmp:
        dst_link_failure(skb);
 tx_error:
        stats->tx_errors++;
        dev_kfree_skb(skb);
-       tunnel->recursion--;
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static void ipip_tunnel_bind_dev(struct net_device *dev)
@@ -713,6 +704,7 @@ static void ipip_tunnel_setup(struct net_device *dev)
        dev->iflink             = 0;
        dev->addr_len           = 4;
        dev->features           |= NETIF_F_NETNS_LOCAL;
+       dev->priv_flags         &= ~IFF_XMIT_DST_RELEASE;
 }
 
 static void ipip_tunnel_init(struct net_device *dev)