* Re: [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add"
[not found] <bug-8755-10286@http.bugzilla.kernel.org/>
@ 2007-07-15 4:47 ` Andrew Morton
2007-07-15 15:07 ` Patrick McHardy
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2007-07-15 4:47 UTC (permalink / raw)
To: netdev; +Cc: bugme-daemon@kernel-bugs.osdl.org, bugzilla
On Sat, 14 Jul 2007 15:21:21 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=8755
>
> Summary: "ip -6 route change " behaves like "ip -6 route add"
> Product: Networking
> Version: 2.5
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: IPV6
> AssignedTo: yoshfuji@linux-ipv6.org
> ReportedBy: bugzilla@fire.lp0.eu
>
>
> The "ip -6 route change" command behaves as though "ip -6 route add" was used.
> The source of iproute2 shows that "change" uses the "NLM_F_REPLACE" netlink
> flag only.
>
> ip utility, iproute2-ss070313
>
> Changing an existing route:
> # ip -6 r show 2002::/16
> 2002::/16 dev sit0 metric 1024 expires 4482618sec mtu 1480 advmss 7140
> hoplimit 4294967295
> # ip -6 r change 2002::/16 dev sit0 mtu 1280
> RTNETLINK answers: File exists
>
> Adding a route using "change":
> # ip -6 r change 2002::/17 dev sit0 mtu 1280
> # ip -6 r show 2002::/17
> 2002::/17 dev sit0 metric 1024 expires 21334368sec mtu 1280 advmss 1220
> hoplimit 4294967295
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add"
2007-07-15 4:47 ` [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add" Andrew Morton
@ 2007-07-15 15:07 ` Patrick McHardy
2007-07-15 18:49 ` Simon Arlott
0 siblings, 1 reply; 6+ messages in thread
From: Patrick McHardy @ 2007-07-15 15:07 UTC (permalink / raw)
To: bugzilla; +Cc: Andrew Morton, netdev, bugme-daemon@kernel-bugs.osdl.org
Andrew Morton wrote:
> On Sat, 14 Jul 2007 15:21:21 -0700 (PDT) bugme-daemon@bugzilla.kernel.org wrote:
>
>>The "ip -6 route change" command behaves as though "ip -6 route add" was used.
>>The source of iproute2 shows that "change" uses the "NLM_F_REPLACE" netlink
>>flag only.
>>
>>ip utility, iproute2-ss070313
>>
>>Changing an existing route:
>># ip -6 r show 2002::/16
>>2002::/16 dev sit0 metric 1024 expires 4482618sec mtu 1480 advmss 7140
>>hoplimit 4294967295
>># ip -6 r change 2002::/16 dev sit0 mtu 1280
>>RTNETLINK answers: File exists
>>
>>Adding a route using "change":
>># ip -6 r change 2002::/17 dev sit0 mtu 1280
>># ip -6 r show 2002::/17
>>2002::/17 dev sit0 metric 1024 expires 21334368sec mtu 1280 advmss 1220
>>hoplimit 4294967295
There is a difference between "add" and "change". "add" will only add a
new address if there isn't already one with the same identity, "change"
will allow to change attributes of an existing address, like flags,
lifetime, ..., or behave similar to "add" in case the address doesn't
already exist.
What kind of behaviour are you expecting?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add"
2007-07-15 15:07 ` Patrick McHardy
@ 2007-07-15 18:49 ` Simon Arlott
2007-07-16 13:01 ` Patrick McHardy
0 siblings, 1 reply; 6+ messages in thread
From: Simon Arlott @ 2007-07-15 18:49 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Andrew Morton, netdev, bugme-daemon@kernel-bugs.osdl.org
On 15/07/07 16:07, Patrick McHardy wrote:
>>>Changing an existing route:
>>># ip -6 r show 2002::/16
>>>2002::/16 dev sit0 metric 1024 expires 4482618sec mtu 1480 advmss 7140
>>>hoplimit 4294967295
>>># ip -6 r change 2002::/16 dev sit0 mtu 1280
>>>RTNETLINK answers: File exists
^ This is clearly a bug, since I'm trying to change an existing route
and it gives an error as if it tried to add it.
>>>Adding a route using "change":
>>># ip -6 r change 2002::/17 dev sit0 mtu 1280
>>># ip -6 r show 2002::/17
>>>2002::/17 dev sit0 metric 1024 expires 21334368sec mtu 1280 advmss 1220
>>>hoplimit 4294967295
^ This shouldn't be possible!
> There is a difference between "add" and "change". "add" will only add a
> new address if there isn't already one with the same identity, "change"
> will allow to change attributes of an existing address, like flags,
> lifetime, ..., or behave similar to "add" in case the address doesn't
> already exist.
>
> What kind of behaviour are you expecting?
That "change" would actually change not simply add. It won't let me
change anything and in fact can only add instead.
Compare it to ipv4 where "change" never adds - "replace" is "change, or
add". (Also, "replace" doesn't work for v6 either).
--
Simon Arlott
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add"
2007-07-15 18:49 ` Simon Arlott
@ 2007-07-16 13:01 ` Patrick McHardy
2007-07-16 18:05 ` Simon Arlott
2007-07-19 18:29 ` Simon Arlott
0 siblings, 2 replies; 6+ messages in thread
From: Patrick McHardy @ 2007-07-16 13:01 UTC (permalink / raw)
To: Simon Arlott; +Cc: Andrew Morton, netdev, bugme-daemon@kernel-bugs.osdl.org
Simon Arlott wrote:
> On 15/07/07 16:07, Patrick McHardy wrote:
>
>>>>Changing an existing route:
>>>># ip -6 r show 2002::/16
>>>>2002::/16 dev sit0 metric 1024 expires 4482618sec mtu 1480 advmss 7140
>>>>hoplimit 4294967295
>>>># ip -6 r change 2002::/16 dev sit0 mtu 1280
>>>>RTNETLINK answers: File exists
>
> ^ This is clearly a bug, since I'm trying to change an existing route
> and it gives an error as if it tried to add it.
Agreed.
>>>>Adding a route using "change":
>>>># ip -6 r change 2002::/17 dev sit0 mtu 1280
>>>># ip -6 r show 2002::/17
>>>>2002::/17 dev sit0 metric 1024 expires 21334368sec mtu 1280 advmss 1220
>>>>hoplimit 4294967295
>
> ^ This shouldn't be possible!
That one will probably be impossible to fix since IPv6 has never checked
for NLM_F_EXCL, doing to now might break things.
>>There is a difference between "add" and "change". "add" will only add a
>>new address if there isn't already one with the same identity, "change"
>>will allow to change attributes of an existing address, like flags,
>>lifetime, ..., or behave similar to "add" in case the address doesn't
>>already exist.
>>
>>What kind of behaviour are you expecting?
>
>
> That "change" would actually change not simply add. It won't let me
> change anything and in fact can only add instead.
The code looks like it would support it properly. Please add a
few printks to inet6_rtm_newaddr to find out what goes wrong.
> Compare it to ipv4 where "change" never adds - "replace" is "change, or
> add". (Also, "replace" doesn't work for v6 either).
IPv4 doesn't check any netlink flags, so I don't think that is correct.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add"
2007-07-16 13:01 ` Patrick McHardy
@ 2007-07-16 18:05 ` Simon Arlott
2007-07-19 18:29 ` Simon Arlott
1 sibling, 0 replies; 6+ messages in thread
From: Simon Arlott @ 2007-07-16 18:05 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Andrew Morton, netdev, bugme-daemon
[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]
On 16/07/07 14:01, Patrick McHardy wrote:
> Simon Arlott wrote:
>> On 15/07/07 16:07, Patrick McHardy wrote:
>>>>>Adding a route using "change":
>>>>># ip -6 r change 2002::/17 dev sit0 mtu 1280
>>>>># ip -6 r show 2002::/17
>>>>>2002::/17 dev sit0 metric 1024 expires 21334368sec mtu 1280 advmss 1220
>>>>>hoplimit 4294967295
>>
>> ^ This shouldn't be possible!
>
>
> That one will probably be impossible to fix since IPv6 has never checked
> for NLM_F_EXCL, doing to now might break things.
NLM_F_EXCL isn't used:
if (matches(*argv, "add") == 0)
return iproute_modify(RTM_NEWROUTE, NLM_F_CREATE|NLM_F_EXCL,
if (matches(*argv, "change") == 0 || strcmp(*argv, "chg") == 0)
return iproute_modify(RTM_NEWROUTE, NLM_F_REPLACE,
if (matches(*argv, "replace") == 0)
return iproute_modify(RTM_NEWROUTE, NLM_F_CREATE|NLM_F_REPLACE,
"test" only uses NLM_F_EXCL... I didn't even know that existed and it's
not shown in help text.
> The code looks like it would support it properly. Please add a
> few printks to inet6_rtm_newaddr to find out what goes wrong.
Ok.
>> Compare it to ipv4 where "change" never adds - "replace" is "change, or
>> add". (Also, "replace" doesn't work for v6 either).
>
>
> IPv4 doesn't check any netlink flags, so I don't think that is correct.
It looks like it works perfectly for add, change, and replace:
# ip r add 2.0.0.0/32 dev lo
# ip r change 3.0.0.0/32 dev lo
RTNETLINK answers: No such file or directory
# ip r replace 3.0.0.0/32 dev lo
# ip r change 2.0.0.0/32 dev lo mtu 100
# ip r
3.0.0.0 dev lo scope link
2.0.0.0 dev lo scope link mtu 100
--
Simon Arlott
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3623 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add"
2007-07-16 13:01 ` Patrick McHardy
2007-07-16 18:05 ` Simon Arlott
@ 2007-07-19 18:29 ` Simon Arlott
1 sibling, 0 replies; 6+ messages in thread
From: Simon Arlott @ 2007-07-19 18:29 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Andrew Morton, netdev, bugme-daemon
[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]
On 16/07/07 14:01, Patrick McHardy wrote:
> Simon Arlott wrote:
>>>>>Changing an existing route:
>>>>># ip -6 r show 2002::/16
>>>>>2002::/16 dev sit0 metric 1024 expires 4482618sec mtu 1480 advmss 7140
>>>>>hoplimit 4294967295
>>>>># ip -6 r change 2002::/16 dev sit0 mtu 1280
>>>>>RTNETLINK answers: File exists
> The code looks like it would support it properly. Please add a
> few printks to inet6_rtm_newaddr to find out what goes wrong.
Erm. It's routing configuration that's broken not address configuration
(ip doesn't even . Looking at route.c through to ip6_fib.c, it doesn't
support replacing routes at all.
$ grep NLM_F_ ipv4/fib_*.c ipv4/route.c ipv6/fib6_* ipv6/ip6_fib.c
ipv6/route.c
ipv4/fib_frontend.c: cfg->fc_nlflags = NLM_F_CREATE;
ipv4/fib_frontend.c: .fc_nlflags = NLM_F_CREATE | NLM_F_APPEND,
ipv4/fib_hash.c: if (cfg->fc_nlflags & NLM_F_EXCL)
ipv4/fib_hash.c: if (cfg->fc_nlflags & NLM_F_REPLACE) {
ipv4/fib_hash.c: &cfg->fc_nlinfo,
NLM_F_REPLACE);
ipv4/fib_hash.c: if (!(cfg->fc_nlflags & NLM_F_APPEND))
ipv4/fib_hash.c: if (!(cfg->fc_nlflags & NLM_F_CREATE))
ipv4/fib_hash.c: NLM_F_MULTI) <
0) {
ipv4/fib_trie.c: if (cfg->fc_nlflags & NLM_F_EXCL)
ipv4/fib_trie.c: if (cfg->fc_nlflags & NLM_F_REPLACE) {
ipv4/fib_trie.c: tb->tb_id,
&cfg->fc_nlinfo, NLM_F_REPLACE);
ipv4/fib_trie.c: if (!(cfg->fc_nlflags & NLM_F_APPEND))
ipv4/fib_trie.c: if (!(cfg->fc_nlflags & NLM_F_CREATE))
ipv4/route.c: 1, NLM_F_MULTI) <= 0) {
ipv6/route.c: prefix, NLM_F_MULTI);
--
Simon Arlott
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3623 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-07-19 18:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <bug-8755-10286@http.bugzilla.kernel.org/>
2007-07-15 4:47 ` [Bugme-new] [Bug 8755] New: "ip -6 route change " behaves like "ip -6 route add" Andrew Morton
2007-07-15 15:07 ` Patrick McHardy
2007-07-15 18:49 ` Simon Arlott
2007-07-16 13:01 ` Patrick McHardy
2007-07-16 18:05 ` Simon Arlott
2007-07-19 18:29 ` Simon Arlott
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).