aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/Kconfig1
-rw-r--r--net/ipv6/ip6_tunnel.c38
-rw-r--r--net/ipv6/netfilter/ip6_queue.c2
-rw-r--r--net/ipv6/netfilter/ip6t_LOG.c11
4 files changed, 42 insertions, 10 deletions
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 95163cd52ae0..ab7a9124f985 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -91,7 +91,6 @@ config INET6_TUNNEL
91config IPV6_TUNNEL 91config IPV6_TUNNEL
92 tristate "IPv6: IPv6-in-IPv6 tunnel" 92 tristate "IPv6: IPv6-in-IPv6 tunnel"
93 depends on IPV6 93 depends on IPV6
94 select INET6_TUNNEL
95 ---help--- 94 ---help---
96 Support for IPv6-in-IPv6 tunnels described in RFC 2473. 95 Support for IPv6-in-IPv6 tunnels described in RFC 2473.
97 96
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index ba3b0c267f75..09613729404c 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1110,11 +1110,39 @@ ip6ip6_fb_tnl_dev_init(struct net_device *dev)
1110 return 0; 1110 return 0;
1111} 1111}
1112 1112
1113#ifdef CONFIG_INET6_TUNNEL
1113static struct xfrm6_tunnel ip6ip6_handler = { 1114static struct xfrm6_tunnel ip6ip6_handler = {
1114 .handler = ip6ip6_rcv, 1115 .handler = ip6ip6_rcv,
1115 .err_handler = ip6ip6_err, 1116 .err_handler = ip6ip6_err,
1116}; 1117};
1117 1118
1119static inline int ip6ip6_register(void)
1120{
1121 return xfrm6_tunnel_register(&ip6ip6_handler);
1122}
1123
1124static inline int ip6ip6_unregister(void)
1125{
1126 return xfrm6_tunnel_deregister(&ip6ip6_handler);
1127}
1128#else
1129static struct inet6_protocol xfrm6_tunnel_protocol = {
1130 .handler = ip6ip6_rcv,
1131 .err_handler = ip6ip6_err,
1132 .flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
1133};
1134
1135static inline int ip6ip6_register(void)
1136{
1137 return inet6_add_protocol(&xfrm6_tunnel_protocol, IPPROTO_IPV6);
1138}
1139
1140static inline int ip6ip6_unregister(void)
1141{
1142 return inet6_del_protocol(&xfrm6_tunnel_protocol, IPPROTO_IPV6);
1143}
1144#endif
1145
1118/** 1146/**
1119 * ip6_tunnel_init - register protocol and reserve needed resources 1147 * ip6_tunnel_init - register protocol and reserve needed resources
1120 * 1148 *
@@ -1125,7 +1153,7 @@ static int __init ip6_tunnel_init(void)
1125{ 1153{
1126 int err; 1154 int err;
1127 1155
1128 if (xfrm6_tunnel_register(&ip6ip6_handler) < 0) { 1156 if (ip6ip6_register() < 0) {
1129 printk(KERN_ERR "ip6ip6 init: can't register tunnel\n"); 1157 printk(KERN_ERR "ip6ip6 init: can't register tunnel\n");
1130 return -EAGAIN; 1158 return -EAGAIN;
1131 } 1159 }
@@ -1144,7 +1172,7 @@ static int __init ip6_tunnel_init(void)
1144 } 1172 }
1145 return 0; 1173 return 0;
1146fail: 1174fail:
1147 xfrm6_tunnel_deregister(&ip6ip6_handler); 1175 ip6ip6_unregister();
1148 return err; 1176 return err;
1149} 1177}
1150 1178
@@ -1154,7 +1182,7 @@ fail:
1154 1182
1155static void __exit ip6_tunnel_cleanup(void) 1183static void __exit ip6_tunnel_cleanup(void)
1156{ 1184{
1157 if (xfrm6_tunnel_deregister(&ip6ip6_handler) < 0) 1185 if (ip6ip6_unregister() < 0)
1158 printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n"); 1186 printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
1159 1187
1160 unregister_netdev(ip6ip6_fb_tnl_dev); 1188 unregister_netdev(ip6ip6_fb_tnl_dev);
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 750943e2d34e..5493180f0d44 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -76,7 +76,9 @@ static DECLARE_MUTEX(ipqnl_sem);
76static void 76static void
77ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict) 77ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)
78{ 78{
79 local_bh_disable();
79 nf_reinject(entry->skb, entry->info, verdict); 80 nf_reinject(entry->skb, entry->info, verdict);
81 local_bh_enable();
80 kfree(entry); 82 kfree(entry);
81} 83}
82 84
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index c44685e391b7..a692e26a4fa3 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -373,9 +373,10 @@ ip6t_log_packet(unsigned int hooknum,
373 in ? in->name : "", 373 in ? in->name : "",
374 out ? out->name : ""); 374 out ? out->name : "");
375 if (in && !out) { 375 if (in && !out) {
376 unsigned int len;
376 /* MAC logging for input chain only. */ 377 /* MAC logging for input chain only. */
377 printk("MAC="); 378 printk("MAC=");
378 if (skb->dev && skb->dev->hard_header_len && 379 if (skb->dev && (len = skb->dev->hard_header_len) &&
379 skb->mac.raw != skb->nh.raw) { 380 skb->mac.raw != skb->nh.raw) {
380 unsigned char *p = skb->mac.raw; 381 unsigned char *p = skb->mac.raw;
381 int i; 382 int i;
@@ -384,9 +385,11 @@ ip6t_log_packet(unsigned int hooknum,
384 (p -= ETH_HLEN) < skb->head) 385 (p -= ETH_HLEN) < skb->head)
385 p = NULL; 386 p = NULL;
386 387
387 if (p != NULL) 388 if (p != NULL) {
388 for (i = 0; i < skb->dev->hard_header_len; i++) 389 for (i = 0; i < len; i++)
389 printk("%02x", p[i]); 390 printk("%02x%s", p[i],
391 i == len - 1 ? "" : ":");
392 }
390 printk(" "); 393 printk(" ");
391 394
392 if (skb->dev->type == ARPHRD_SIT) { 395 if (skb->dev->type == ARPHRD_SIT) {