* Re: ip route del bug?
[not found] <427A3370.3090001@skywaywest.com>
@ 2005-05-05 18:35 ` Stephen Hemminger
2005-05-05 18:52 ` Patrick McHardy
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2005-05-05 18:35 UTC (permalink / raw)
To: Jamal Hadi Salim, netdev
On Thu, 05 May 2005 07:53:36 -0700
Greg Varga <gvarga@skywaywest.com> wrote:
> Hey there,
>
> I was working on one of our Linux routers yesterday, and when I issued a
> "ip route del" command (no arg's) by mistake, it deleted the default route.
>
> I was just wondering if this is indeed the way it was intended, or if
> its a bug and in fact should have displayed an error message? I
> personally would have preferred that it error'd with some sort of message.
>
> I'm running Fedora Core 2 with iproute-2.4.7-14 rpm installed.
>
> Thanks,
> --Greg
It looks like an accidental behaviour (of the kernel) in response to
an ip route delete netlink message with no additional data.
Comments?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ip route del bug?
2005-05-05 18:35 ` ip route del bug? Stephen Hemminger
@ 2005-05-05 18:52 ` Patrick McHardy
2005-05-05 19:15 ` Jamal Hadi Salim
0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2005-05-05 18:52 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Jamal Hadi Salim, netdev
Stephen Hemminger wrote:
> It looks like an accidental behaviour (of the kernel) in response to
> an ip route delete netlink message with no additional data.
I don't believe it is accidental, it seems correct to me to delete
the default route when no more specific selector is given. To avoid
this, iproute could print an error when dst.bytelen == 0.
Regards
Patrick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ip route del bug?
2005-05-05 18:52 ` Patrick McHardy
@ 2005-05-05 19:15 ` Jamal Hadi Salim
0 siblings, 0 replies; 3+ messages in thread
From: Jamal Hadi Salim @ 2005-05-05 19:15 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Stephen Hemminger, netdev
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
On Thu, 2005-05-05 at 20:52 +0200, Patrick McHardy wrote:
> Stephen Hemminger wrote:
> > It looks like an accidental behaviour (of the kernel) in response to
> > an ip route delete netlink message with no additional data.
>
> I don't believe it is accidental, it seems correct to me to delete
> the default route when no more specific selector is given. To avoid
> this, iproute could print an error when dst.bytelen == 0.
Agreed - basically the kernel does what its told.
I think the check should be on missing dst (default will always give you
bytelen of 0 for example and is legit).
Patchlet attached.
cheers,
jamal
[-- Attachment #2: iprdl_p --]
[-- Type: text/plain, Size: 273 bytes --]
--- a/ip/iproute.c 2005/05/05 18:56:30 1.1
+++ b/ip/iproute.c 2005/05/05 19:10:49
@@ -857,6 +857,11 @@
argc--; argv++;
}
+ if (!dst_ok) {
+ fprintf(stderr,"route must specify destination address \n");
+ return -1;
+ }
+
if (rtnl_open(&rth, 0) < 0)
exit(1);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-05-05 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <427A3370.3090001@skywaywest.com>
2005-05-05 18:35 ` ip route del bug? Stephen Hemminger
2005-05-05 18:52 ` Patrick McHardy
2005-05-05 19:15 ` Jamal Hadi Salim
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).