X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fipv4%2Fipip.c;h=1c1c2e1d429bb9ab7704c627708382d303fea537;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=98ba22404ac37144be32a675304f05be4f65afda;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 98ba22404..1c1c2e1d4 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -246,7 +246,6 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c nt = dev->priv; SET_MODULE_OWNER(dev); dev->init = ipip_tunnel_init; - dev->destructor = free_netdev; nt->parms = *parms; if (register_netdevice(dev) < 0) { @@ -461,8 +460,7 @@ static inline void ipip_ecn_decapsulate(struct iphdr *outer_iph, struct sk_buff { struct iphdr *inner_iph = skb->nh.iph; - if (INET_ECN_is_ce(outer_iph->tos) && - INET_ECN_is_not_ce(inner_iph->tos)) + if (INET_ECN_is_ce(outer_iph->tos)) IP_ECN_set_ce(inner_iph); } @@ -785,6 +783,7 @@ static void ipip_tunnel_setup(struct net_device *dev) dev->get_stats = ipip_tunnel_get_stats; dev->do_ioctl = ipip_tunnel_ioctl; dev->change_mtu = ipip_tunnel_change_mtu; + dev->destructor = free_netdev; dev->type = ARPHRD_TUNNEL; dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); @@ -877,18 +876,19 @@ static int __init ipip_init(void) ipip_tunnel_setup); if (!ipip_fb_tunnel_dev) { err = -ENOMEM; - goto fail; + goto err1; } ipip_fb_tunnel_dev->init = ipip_fb_tunnel_init; if ((err = register_netdev(ipip_fb_tunnel_dev))) - goto fail; + goto err2; out: return err; - fail: - xfrm4_tunnel_deregister(&ipip_handler); + err2: free_netdev(ipip_fb_tunnel_dev); + err1: + xfrm4_tunnel_deregister(&ipip_handler); goto out; }