Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1170333
| From | YOSHIFUJI Hideaki/吉藤英明 <hideaki.yoshifuji@miraclelinux.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] ipv6: Fixed source specific default route handling. |
| Date | 2015-06-23 04:00 +0200 |
| Message-ID | <pElFg-50j-9@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <pDR4t-34v-1@gated-at.bofh.it> <pDVKN-1tA-1@gated-at.bofh.it> <pDW4a-1PP-5@gated-at.bofh.it> <pE3p0-3ZS-15@gated-at.bofh.it> <pEeaJ-2n7-9@gated-at.bofh.it> |
| Organization | MIRACLE LINUX CORPORATION |
Matthias Schiffer wrote: > On 06/22/2015 07:58 AM, Steven Barth wrote: >> On 22.06.2015 00:35, Matthias Schiffer wrote: >>> Could you explain in detail what you mean with "If you want specific SA, >>> add same route with higher metric and/or (more) specific src match."? >>> Routes aren't bound to specific addresses except via the "src" attribute >>> (which is called prefsrc in the kernel), which is exactly what it not >>> working. I can't control the chosen source address at all when >>> source-specific routes are involved. >> Except that prefsrc and src are two different beasts and usually ip route from transates to >> RTA_SRC instead of RTA_PREFSOURCE when used with a prefix length. >> >> Try adding two routes to the same destination with the same metric but different source values with PREFSRC (e.g. IPv4) and then >> try doing the same with SRC (e.g. IPv6). The former will fail but the latter will succeed. > > Ah sorry, I didn't know that "src" and "prefsrc" were distinct concepts. > I meant to refer to "src" whenever I wrote "prefsrc". What are the > precise semantics of the "src" attribute? Any RFC I can read, or is this > a Linux-specific concept? > "src" is long-lived feature which is usually used with mutiple routing tables by "ip rule". --yoshfuji >> >> >> https://tools.ietf.org/html/draft-troan-homenet-sadr-01 >> was the original draft for source-address dependent routing IIRC so might be a good read. > > Thanks for the link, that helps a bit. > >> >> >>> >>> Even though the source-specific route has a higher metric than the >>> generic one, the source-specific one shadows the generic route. >> >> (was a bit ago since I read into this so please correct me if I am wrong) >> IIRC this is intentional since longest-prefix-match beats metric here >> and the source-address match counts to being more-specific here. See also above difference between PREFSRC and SRC. > > Ah, that would explain the metric issue. I looks like the source of my > confusion is that for source-specific routes *all* addresses are in the > candidate set, not only the addresses of the outgoing interface (which > makes sense as ip6_route_get_saddr() is called with a NULL rt6_info in > the source-specific case). > > I'm not sure if this can be fixed in a sane way (as there seems to be a > dependency cycle: source address should depend on outgoing interface, > which depends on the chosen route, which depends on the source address), > but it leads to highly unintuitive source address selection :( > > Markus suggested in the commit message not to call ip6_route_output at > all before the source address has been selected. Wouldn't this make it > impossible to choose the source address depending on the outgoing > interface in the non-source-specific case as well? > >> Cheers, >> >> Steven > > Thanks for the explanation, > Matthias > -- 吉藤英明 <hideaki.yoshifuji@miraclelinux.com> ミラクル・リナックス株式会社 技術本部 サポート部 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH] ipv6: Fixed source specific default route handling. Matthias Schiffer <mschiffer@universe-factory.net> - 2015-06-21 19:20 +0200
Re: [PATCH] ipv6: Fixed source specific default route handling. Markus Stenberg <markus.stenberg@iki.fi> - 2015-06-22 01:20 +0200
Re: [PATCH] ipv6: Fixed source specific default route handling. Steven Barth <steven@midlink.org> - 2015-06-22 08:30 +0200
Re: [PATCH] ipv6: Fixed source specific default route handling. YOSHIFUJI Hideaki/吉藤英明 <hideaki.yoshifuji@miraclelinux.com> - 2015-06-23 04:00 +0200
csiph-web