diff options
Diffstat (limited to 'net/ipv6')
| -rw-r--r-- | net/ipv6/Makefile | 2 | ||||
| -rw-r--r-- | net/ipv6/ip6_output.c | 32 | ||||
| -rw-r--r-- | net/ipv6/ipv6_syms.c | 3 | ||||
| -rw-r--r-- | net/ipv6/netfilter.c | 43 |
4 files changed, 44 insertions, 36 deletions
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile index b39e04940590..5bccea2d81b4 100644 --- a/net/ipv6/Makefile +++ b/net/ipv6/Makefile | |||
| @@ -8,7 +8,7 @@ ipv6-objs := af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o sit.o \ | |||
| 8 | route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \ | 8 | route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \ |
| 9 | protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ | 9 | protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ |
| 10 | exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \ | 10 | exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \ |
| 11 | ip6_flowlabel.o ipv6_syms.o | 11 | ip6_flowlabel.o ipv6_syms.o netfilter.o |
| 12 | 12 | ||
| 13 | ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \ | 13 | ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \ |
| 14 | xfrm6_output.o | 14 | xfrm6_output.o |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 590d2b797197..a7fcbcc83576 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -153,38 +153,6 @@ int ip6_output(struct sk_buff *skb) | |||
| 153 | return ip6_output2(skb); | 153 | return ip6_output2(skb); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | #ifdef CONFIG_NETFILTER | ||
| 157 | int ip6_route_me_harder(struct sk_buff *skb) | ||
| 158 | { | ||
| 159 | struct ipv6hdr *iph = skb->nh.ipv6h; | ||
| 160 | struct dst_entry *dst; | ||
| 161 | struct flowi fl = { | ||
| 162 | .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0, | ||
| 163 | .nl_u = | ||
| 164 | { .ip6_u = | ||
| 165 | { .daddr = iph->daddr, | ||
| 166 | .saddr = iph->saddr, } }, | ||
| 167 | .proto = iph->nexthdr, | ||
| 168 | }; | ||
| 169 | |||
| 170 | dst = ip6_route_output(skb->sk, &fl); | ||
| 171 | |||
| 172 | if (dst->error) { | ||
| 173 | IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES); | ||
| 174 | LIMIT_NETDEBUG( | ||
| 175 | printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n")); | ||
| 176 | dst_release(dst); | ||
| 177 | return -EINVAL; | ||
| 178 | } | ||
| 179 | |||
| 180 | /* Drop old route. */ | ||
| 181 | dst_release(skb->dst); | ||
| 182 | |||
| 183 | skb->dst = dst; | ||
| 184 | return 0; | ||
| 185 | } | ||
| 186 | #endif | ||
| 187 | |||
| 188 | /* | 156 | /* |
| 189 | * xmit an sk_buff (used by TCP) | 157 | * xmit an sk_buff (used by TCP) |
| 190 | */ | 158 | */ |
diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c index 5ade5a5d1990..37a4a99c9fe9 100644 --- a/net/ipv6/ipv6_syms.c +++ b/net/ipv6/ipv6_syms.c | |||
| @@ -15,9 +15,6 @@ EXPORT_SYMBOL(ndisc_mc_map); | |||
| 15 | EXPORT_SYMBOL(register_inet6addr_notifier); | 15 | EXPORT_SYMBOL(register_inet6addr_notifier); |
| 16 | EXPORT_SYMBOL(unregister_inet6addr_notifier); | 16 | EXPORT_SYMBOL(unregister_inet6addr_notifier); |
| 17 | EXPORT_SYMBOL(ip6_route_output); | 17 | EXPORT_SYMBOL(ip6_route_output); |
| 18 | #ifdef CONFIG_NETFILTER | ||
| 19 | EXPORT_SYMBOL(ip6_route_me_harder); | ||
| 20 | #endif | ||
| 21 | EXPORT_SYMBOL(addrconf_lock); | 18 | EXPORT_SYMBOL(addrconf_lock); |
| 22 | EXPORT_SYMBOL(ipv6_setsockopt); | 19 | EXPORT_SYMBOL(ipv6_setsockopt); |
| 23 | EXPORT_SYMBOL(ipv6_getsockopt); | 20 | EXPORT_SYMBOL(ipv6_getsockopt); |
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c new file mode 100644 index 000000000000..5656d0959aba --- /dev/null +++ b/net/ipv6/netfilter.c | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #include <linux/config.h> | ||
| 2 | #include <linux/init.h> | ||
| 3 | |||
| 4 | #ifdef CONFIG_NETFILTER | ||
| 5 | |||
| 6 | #include <linux/kernel.h> | ||
| 7 | #include <linux/ipv6.h> | ||
| 8 | #include <net/dst.h> | ||
| 9 | #include <net/ipv6.h> | ||
| 10 | #include <net/ip6_route.h> | ||
| 11 | |||
| 12 | int ip6_route_me_harder(struct sk_buff *skb) | ||
| 13 | { | ||
| 14 | struct ipv6hdr *iph = skb->nh.ipv6h; | ||
| 15 | struct dst_entry *dst; | ||
| 16 | struct flowi fl = { | ||
| 17 | .oif = skb->sk ? skb->sk->sk_bound_dev_if : 0, | ||
| 18 | .nl_u = | ||
| 19 | { .ip6_u = | ||
| 20 | { .daddr = iph->daddr, | ||
| 21 | .saddr = iph->saddr, } }, | ||
| 22 | .proto = iph->nexthdr, | ||
| 23 | }; | ||
| 24 | |||
| 25 | dst = ip6_route_output(skb->sk, &fl); | ||
| 26 | |||
| 27 | if (dst->error) { | ||
| 28 | IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES); | ||
| 29 | LIMIT_NETDEBUG( | ||
| 30 | printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n")); | ||
| 31 | dst_release(dst); | ||
| 32 | return -EINVAL; | ||
| 33 | } | ||
| 34 | |||
| 35 | /* Drop old route. */ | ||
| 36 | dst_release(skb->dst); | ||
| 37 | |||
| 38 | skb->dst = dst; | ||
| 39 | return 0; | ||
| 40 | } | ||
| 41 | EXPORT_SYMBOL(ip6_route_me_harder); | ||
| 42 | |||
| 43 | #endif /* CONFIG_NETFILTER */ | ||
