[UDP]: Make full use of proto.h.udp_hash innovation.
[deliverable/linux.git] / net / ipv4 / ipip.c
index e77e3b8558340d9f60f2f42a6a9eb7bc8e8720bb..894bce96284ab44bf94650567be5cc05e58c4318 100644 (file)
@@ -228,20 +228,24 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c
        if (dev == NULL)
                return NULL;
 
+       if (strchr(name, '%')) {
+               if (dev_alloc_name(dev, name) < 0)
+                       goto failed_free;
+       }
+
        nt = netdev_priv(dev);
        dev->init = ipip_tunnel_init;
        nt->parms = *parms;
 
-       if (register_netdevice(dev) < 0) {
-               free_netdev(dev);
-               goto failed;
-       }
+       if (register_netdevice(dev) < 0)
+               goto failed_free;
 
        dev_hold(dev);
        ipip_tunnel_link(nt);
        return nt;
 
-failed:
+failed_free:
+       free_netdev(dev);
        return NULL;
 }
 
@@ -524,7 +528,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (!dst) {
                /* NBMA tunnel */
-               if ((rt = (struct rtable*)skb->dst) == NULL) {
+               if ((rt = skb->rtable) == NULL) {
                        tunnel->stat.tx_fifo_errors++;
                        goto tx_error;
                }
This page took 0.035343 seconds and 5 git commands to generate.