diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-07-26 09:55:10 -0500 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-07-26 09:55:10 -0500 |
commit | de8fd087b280797977b012a4275ee53ff2999f3f (patch) | |
tree | 5cd65289983ad65812a6a4335fe657eeb125a7f0 /net/ipv4/ipip.c | |
parent | 18190cc08d70a6ec8ef69f0f6ede021f7cb3f9b8 (diff) | |
parent | 6b6a93c6876ea1c530d5d3f68e3678093a27fab0 (diff) | |
download | talos-obmc-linux-de8fd087b280797977b012a4275ee53ff2999f3f.tar.gz talos-obmc-linux-de8fd087b280797977b012a4275ee53ff2999f3f.zip |
Merge with /home/shaggy/git/linus-clean/
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 68a78731f722..c3947cd566b7 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -273,7 +273,7 @@ static void ipip_tunnel_uninit(struct net_device *dev) dev_put(dev); } -static void ipip_err(struct sk_buff *skb, void *__unused) +static void ipip_err(struct sk_buff *skb, u32 info) { #ifndef I_WISH_WORLD_WERE_PERFECT @@ -852,11 +852,39 @@ static int __init ipip_fb_tunnel_init(struct net_device *dev) return 0; } +#ifdef CONFIG_INET_TUNNEL static struct xfrm_tunnel ipip_handler = { .handler = ipip_rcv, .err_handler = ipip_err, }; +static inline int ipip_register(void) +{ + return xfrm4_tunnel_register(&ipip_handler); +} + +static inline int ipip_unregister(void) +{ + return xfrm4_tunnel_deregister(&ipip_handler); +} +#else +static struct net_protocol ipip_protocol = { + .handler = ipip_rcv, + .err_handler = ipip_err, + .no_policy = 1, +}; + +static inline int ipip_register(void) +{ + return inet_add_protocol(&ipip_protocol, IPPROTO_IPIP); +} + +static inline int ipip_unregister(void) +{ + return inet_del_protocol(&ipip_protocol, IPPROTO_IPIP); +} +#endif + static char banner[] __initdata = KERN_INFO "IPv4 over IPv4 tunneling driver\n"; @@ -866,7 +894,7 @@ static int __init ipip_init(void) printk(banner); - if (xfrm4_tunnel_register(&ipip_handler) < 0) { + if (ipip_register() < 0) { printk(KERN_INFO "ipip init: can't register tunnel\n"); return -EAGAIN; } @@ -888,13 +916,13 @@ static int __init ipip_init(void) err2: free_netdev(ipip_fb_tunnel_dev); err1: - xfrm4_tunnel_deregister(&ipip_handler); + ipip_unregister(); goto out; } static void __exit ipip_fini(void) { - if (xfrm4_tunnel_deregister(&ipip_handler) < 0) + if (ipip_unregister() < 0) printk(KERN_INFO "ipip close: can't deregister tunnel\n"); unregister_netdev(ipip_fb_tunnel_dev); |