* [IPROUTE]: Add support for multipath route realms
@ 2006-07-25 3:58 Patrick McHardy
2006-07-25 8:19 ` Herbert Xu
2006-08-04 17:52 ` Stephen Hemminger
0 siblings, 2 replies; 6+ messages in thread
From: Patrick McHardy @ 2006-07-25 3:58 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Kernel Netdev Mailing List
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 2783 bytes --]
[IPROUTE]: Add support for multipath route realms
Routing realms exist per nexthop, but iproute currently only allows to send
a single route realm, which is refused by the kernel for multipath routes.
Add support for specifying per nexthop realms. Old kernels only return the
first realm back to userspace when dumping, so the others can't be displayed,
besides that it will also behave correctly on old kernels.
old kernel:
1.2.3.4 realm 1
nexthop dev dummy0 weight 1
nexthop dev dummy1 weight 1
nexthop dev dummy2 weight 1
nexthop dev dummy3 weight 1
new kernel:
1.2.3.4
nexthop realm 1 dev dummy0 weight 1
nexthop realm 2 dev dummy1 weight 1
nexthop realm 3 dev dummy2 weight 1
nexthop realm 4 dev dummy3 weight 1
route queries on both old and new kernel:
1.2.3.4 dev dummy0 src 10.0.0.1 realm 1
cache mtu 1500 advmss 1460 metric 10 64
1.2.3.4 dev dummy1 src 10.0.0.1 realm 2
cache mtu 1500 advmss 1460 metric 10 64
1.2.3.4 dev dummy2 src 10.0.0.1 realm 3
cache mtu 1500 advmss 1460 metric 10 64
1.2.3.4 dev dummy3 src 10.0.0.1 realm 4
cache mtu 1500 advmss 1460 metric 10 64
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit dbc39a8d37d658776a8959d2393b1047ea124436
tree be59669a06709aaa3b194f050529fe3986928dc8
parent 8f8a36487119a3cd1afe86a9649704aca088567b
author Patrick McHardy <kaber@trash.net> Tue, 25 Jul 2006 05:55:36 +0200
committer Patrick McHardy <kaber@trash.net> Tue, 25 Jul 2006 05:55:36 +0200
ip/iproute.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index a43c09e..3544f02 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -557,6 +557,18 @@ #endif
RTA_DATA(tb[RTA_GATEWAY]),
abuf, sizeof(abuf)));
}
+ if (tb[RTA_FLOW]) {
+ __u32 to = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
+ __u32 from = to>>16;
+ to &= 0xFFFF;
+ fprintf(fp, " realm%s ", from ? "s" : "");
+ if (from) {
+ fprintf(fp, "%s/",
+ rtnl_rtrealm_n2a(from, b1, sizeof(b1)));
+ }
+ fprintf(fp, "%s",
+ rtnl_rtrealm_n2a(to, b1, sizeof(b1)));
+ }
}
if (r->rtm_flags&RTM_F_CLONED && r->rtm_type == RTN_MULTICAST) {
fprintf(fp, " %s", ll_index_to_name(nh->rtnh_ifindex));
@@ -606,6 +618,13 @@ int parse_one_nh(struct rtattr *rta, str
rtnh->rtnh_hops = w - 1;
} else if (strcmp(*argv, "onlink") == 0) {
rtnh->rtnh_flags |= RTNH_F_ONLINK;
+ } else if (matches(*argv, "realms") == 0) {
+ __u32 realm;
+ NEXT_ARG();
+ if (get_rt_realms(&realm, *argv))
+ invarg("\"realm\" value is invalid\n", *argv);
+ rta_addattr32(rta, 4096, RTA_FLOW, realm);
+ rtnh->rtnh_len += sizeof(struct rtattr) + 4;
} else
break;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [IPROUTE]: Add support for multipath route realms
2006-07-25 3:58 [IPROUTE]: Add support for multipath route realms Patrick McHardy
@ 2006-07-25 8:19 ` Herbert Xu
2006-07-25 8:21 ` Herbert Xu
2006-07-25 8:21 ` Patrick McHardy
2006-08-04 17:52 ` Stephen Hemminger
1 sibling, 2 replies; 6+ messages in thread
From: Herbert Xu @ 2006-07-25 8:19 UTC (permalink / raw)
To: Patrick McHardy; +Cc: shemminger, netdev
Patrick McHardy <kaber@trash.net> wrote:
>
> [IPROUTE]: Add support for multipath route realms
>
> Routing realms exist per nexthop, but iproute currently only allows to send
> a single route realm, which is refused by the kernel for multipath routes.
> Add support for specifying per nexthop realms. Old kernels only return the
> first realm back to userspace when dumping, so the others can't be displayed,
> besides that it will also behave correctly on old kernels.
>
> old kernel:
>
> 1.2.3.4 realm 1
> nexthop dev dummy0 weight 1
> nexthop dev dummy1 weight 1
> nexthop dev dummy2 weight 1
> nexthop dev dummy3 weight 1
>
> new kernel:
>
> 1.2.3.4
> nexthop realm 1 dev dummy0 weight 1
> nexthop realm 2 dev dummy1 weight 1
> nexthop realm 3 dev dummy2 weight 1
> nexthop realm 4 dev dummy3 weight 1
This really looks like papering over fundamental brokenness of
IP_ROUTE_MULTIPATH_CACHED since you wouldn't otherwise get these
entries in the routing cache.
This reminds me that I better revisit the reasons that people gave
for actually using IP_ROUTE_MULTIPATH_CACHED the last time we tried
to get rid of it.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [IPROUTE]: Add support for multipath route realms
2006-07-25 8:19 ` Herbert Xu
@ 2006-07-25 8:21 ` Herbert Xu
2006-07-25 8:21 ` Patrick McHardy
1 sibling, 0 replies; 6+ messages in thread
From: Herbert Xu @ 2006-07-25 8:21 UTC (permalink / raw)
To: Patrick McHardy; +Cc: shemminger, netdev
On Tue, Jul 25, 2006 at 06:19:33PM +1000, Herbert Xu wrote:
>
> > new kernel:
> >
> > 1.2.3.4
> > nexthop realm 1 dev dummy0 weight 1
> > nexthop realm 2 dev dummy1 weight 1
> > nexthop realm 3 dev dummy2 weight 1
> > nexthop realm 4 dev dummy3 weight 1
>
> This really looks like papering over fundamental brokenness of
> IP_ROUTE_MULTIPATH_CACHED since you wouldn't otherwise get these
> entries in the routing cache.
Nevermind, I misread your changelog. Your patch is obviously
not related to IP_ROUTE_MULTIPATH_CACHED :)
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [IPROUTE]: Add support for multipath route realms
2006-07-25 8:19 ` Herbert Xu
2006-07-25 8:21 ` Herbert Xu
@ 2006-07-25 8:21 ` Patrick McHardy
1 sibling, 0 replies; 6+ messages in thread
From: Patrick McHardy @ 2006-07-25 8:21 UTC (permalink / raw)
To: Herbert Xu; +Cc: shemminger, netdev
Herbert Xu wrote:
> Patrick McHardy <kaber@trash.net> wrote:
>
>>[IPROUTE]: Add support for multipath route realms
>>
>>Routing realms exist per nexthop, but iproute currently only allows to send
>>a single route realm, which is refused by the kernel for multipath routes.
>>Add support for specifying per nexthop realms. Old kernels only return the
>>first realm back to userspace when dumping, so the others can't be displayed,
>>besides that it will also behave correctly on old kernels.
>>
>>old kernel:
>>
>>1.2.3.4 realm 1
>> nexthop dev dummy0 weight 1
>> nexthop dev dummy1 weight 1
>> nexthop dev dummy2 weight 1
>> nexthop dev dummy3 weight 1
>>
>>new kernel:
>>
>>1.2.3.4
>> nexthop realm 1 dev dummy0 weight 1
>> nexthop realm 2 dev dummy1 weight 1
>> nexthop realm 3 dev dummy2 weight 1
>> nexthop realm 4 dev dummy3 weight 1
>
>
> This really looks like papering over fundamental brokenness of
> IP_ROUTE_MULTIPATH_CACHED since you wouldn't otherwise get these
> entries in the routing cache.
>
> This reminds me that I better revisit the reasons that people gave
> for actually using IP_ROUTE_MULTIPATH_CACHED the last time we tried
> to get rid of it.
Actually it has nothing to do with MULTIPATH_CACHED, it didn't even
use it in these tests unless I seriously mixed something up. The
realm can be used by netfilter to find out which nexthop was chosen
and bind the connection to this nexthop manually using CONNMARK
and MARK.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [IPROUTE]: Add support for multipath route realms
2006-07-25 3:58 [IPROUTE]: Add support for multipath route realms Patrick McHardy
2006-07-25 8:19 ` Herbert Xu
@ 2006-08-04 17:52 ` Stephen Hemminger
2006-08-04 19:17 ` Patrick McHardy
1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2006-08-04 17:52 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Kernel Netdev Mailing List
On Tue, 25 Jul 2006 05:58:36 +0200
Patrick McHardy <kaber@trash.net> wrote:
applied
--
Stephen Hemminger <shemminger@osdl.org>
"And in the Packet there writ down that doome"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [IPROUTE]: Add support for multipath route realms
2006-08-04 17:52 ` Stephen Hemminger
@ 2006-08-04 19:17 ` Patrick McHardy
0 siblings, 0 replies; 6+ messages in thread
From: Patrick McHardy @ 2006-08-04 19:17 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Kernel Netdev Mailing List
Stephen Hemminger wrote:
> applied
Have you had a chance to look at the time cleanup patches
and the increased number of routing rule patch? Please let
me know if you want me to resend.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-08-04 19:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-25 3:58 [IPROUTE]: Add support for multipath route realms Patrick McHardy
2006-07-25 8:19 ` Herbert Xu
2006-07-25 8:21 ` Herbert Xu
2006-07-25 8:21 ` Patrick McHardy
2006-08-04 17:52 ` Stephen Hemminger
2006-08-04 19:17 ` Patrick McHardy
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).