All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <hadi@znyx.com>
To: Patrick McHardy <kaber@trash.net>
Cc: Stephen Hemminger <shemminger@osdl.org>, netdev@oss.sgi.com
Subject: Re: ip route del bug?
Date: Thu, 05 May 2005 15:15:24 -0400	[thread overview]
Message-ID: <1115320524.8006.50.camel@localhost.localdomain> (raw)
In-Reply-To: <427A6B77.1030200@trash.net>

[-- 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);
 

      reply	other threads:[~2005-05-05 19:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1115320524.8006.50.camel@localhost.localdomain \
    --to=hadi@znyx.com \
    --cc=kaber@trash.net \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.