* [PATCH] net: Implement Any-IP support for IPv6.
@ 2010-09-27 10:07 Maciej Żenczykowski
2010-09-28 20:59 ` David Miller
2010-09-29 8:02 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Maciej Żenczykowski @ 2010-09-27 10:07 UTC (permalink / raw)
To: David Miller, netdev; +Cc: Maciej Żenczykowski
From: Maciej Żenczykowski <maze@google.com>
AnyIP is the capability to receive packets and establish incoming
connections on IPs we have not explicitly configured on the machine.
An example use case is to configure a machine to accept all incoming
traffic on eth0, and leave the policy of whether traffic for a given IP
should be delivered to the machine up to the load balancer.
Can be setup as follows:
ip -6 rule from all iif eth0 lookup 200
ip -6 route add local default dev lo table 200
(in this case for all IPv6 addresses)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
net/ipv6/route.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d126365..3a74f90 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1169,6 +1169,8 @@ int ip6_route_add(struct fib6_config *cfg)
if (addr_type & IPV6_ADDR_MULTICAST)
rt->dst.input = ip6_mc_input;
+ else if (cfg->fc_flags & RTF_LOCAL)
+ rt->dst.input = ip6_input;
else
rt->dst.input = ip6_forward;
@@ -1190,7 +1192,8 @@ int ip6_route_add(struct fib6_config *cfg)
they would result in kernel looping; promote them to reject routes
*/
if ((cfg->fc_flags & RTF_REJECT) ||
- (dev && (dev->flags&IFF_LOOPBACK) && !(addr_type&IPV6_ADDR_LOOPBACK))) {
+ (dev && (dev->flags&IFF_LOOPBACK) && !(addr_type&IPV6_ADDR_LOOPBACK)
+ && !(cfg->fc_flags&RTF_LOCAL))) {
/* hold loopback dev/idev if we haven't done so. */
if (dev != net->loopback_dev) {
if (dev) {
@@ -2082,6 +2085,9 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
if (rtm->rtm_type == RTN_UNREACHABLE)
cfg->fc_flags |= RTF_REJECT;
+ if (rtm->rtm_type == RTN_LOCAL)
+ cfg->fc_flags |= RTF_LOCAL;
+
cfg->fc_nlinfo.pid = NETLINK_CB(skb).pid;
cfg->fc_nlinfo.nlh = nlh;
cfg->fc_nlinfo.nl_net = sock_net(skb->sk);
@@ -2202,6 +2208,8 @@ static int rt6_fill_node(struct net *net,
NLA_PUT_U32(skb, RTA_TABLE, table);
if (rt->rt6i_flags&RTF_REJECT)
rtm->rtm_type = RTN_UNREACHABLE;
+ else if (rt->rt6i_flags&RTF_LOCAL)
+ rtm->rtm_type = RTN_LOCAL;
else if (rt->rt6i_dev && (rt->rt6i_dev->flags&IFF_LOOPBACK))
rtm->rtm_type = RTN_LOCAL;
else
--
1.7.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net: Implement Any-IP support for IPv6.
2010-09-27 10:07 [PATCH] net: Implement Any-IP support for IPv6 Maciej Żenczykowski
@ 2010-09-28 20:59 ` David Miller
2010-09-28 21:04 ` Maciej Żenczykowski
2010-09-29 8:02 ` David Miller
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2010-09-28 20:59 UTC (permalink / raw)
To: zenczykowski; +Cc: netdev, maze
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Mon, 27 Sep 2010 03:07:02 -0700
> From: Maciej Żenczykowski <maze@google.com>
>
> AnyIP is the capability to receive packets and establish incoming
> connections on IPs we have not explicitly configured on the machine.
>
> An example use case is to configure a machine to accept all incoming
> traffic on eth0, and leave the policy of whether traffic for a given IP
> should be delivered to the machine up to the load balancer.
>
> Can be setup as follows:
> ip -6 rule from all iif eth0 lookup 200
> ip -6 route add local default dev lo table 200
> (in this case for all IPv6 addresses)
>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
Does this already work on the ipv4 side?
If not, why only add it to ipv6?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: Implement Any-IP support for IPv6.
2010-09-28 20:59 ` David Miller
@ 2010-09-28 21:04 ` Maciej Żenczykowski
2010-09-28 21:17 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Maciej Żenczykowski @ 2010-09-28 21:04 UTC (permalink / raw)
To: David Miller; +Cc: netdev
AFAIK, Tom Herbert did post the ipv4 patch some time back.
http://patchwork.ozlabs.org/patch/53381/
I think the ipv6 code path (and hence the patch itself) is much cleaner.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: Implement Any-IP support for IPv6.
2010-09-28 21:04 ` Maciej Żenczykowski
@ 2010-09-28 21:17 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-09-28 21:17 UTC (permalink / raw)
To: zenczykowski; +Cc: netdev
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Tue, 28 Sep 2010 14:04:47 -0700
> AFAIK, Tom Herbert did post the ipv4 patch some time back.
>
> http://patchwork.ozlabs.org/patch/53381/
>
> I think the ipv6 code path (and hence the patch itself) is much cleaner.
Ok, I've moved that patch back to under-review state, maybe we
can get them both in at the same time.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: Implement Any-IP support for IPv6.
2010-09-27 10:07 [PATCH] net: Implement Any-IP support for IPv6 Maciej Żenczykowski
2010-09-28 20:59 ` David Miller
@ 2010-09-29 8:02 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2010-09-29 8:02 UTC (permalink / raw)
To: zenczykowski; +Cc: netdev, maze
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Mon, 27 Sep 2010 03:07:02 -0700
> From: Maciej Żenczykowski <maze@google.com>
>
> AnyIP is the capability to receive packets and establish incoming
> connections on IPs we have not explicitly configured on the machine.
>
> An example use case is to configure a machine to accept all incoming
> traffic on eth0, and leave the policy of whether traffic for a given IP
> should be delivered to the machine up to the load balancer.
>
> Can be setup as follows:
> ip -6 rule from all iif eth0 lookup 200
> ip -6 route add local default dev lo table 200
> (in this case for all IPv6 addresses)
>
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
Ok, I applied this and Tom's ipv4-side patch and pushed it all
out to net-next-2.6
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-09-29 8:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 10:07 [PATCH] net: Implement Any-IP support for IPv6 Maciej Żenczykowski
2010-09-28 20:59 ` David Miller
2010-09-28 21:04 ` Maciej Żenczykowski
2010-09-28 21:17 ` David Miller
2010-09-29 8:02 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).