diff mbox

[iproute2] ip route: don't assume default route

Message ID 20141202164510.GA9005@mole.pavlix.net
State Accepted, archived
Delegated to: stephen hemminger
Headers show

Commit Message

Pavel Simerda Dec. 2, 2014, 4:45 p.m. UTC
Just print the help when "ip route del" is called without any other
arguments.

Resolves:

 * https://bugzilla.redhat.com/show_bug.cgi?id=997965

Signed-off-by: Pavel Šimerda <psimerda@redhat.com>
---
 ip/iproute.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

stephen hemminger Dec. 3, 2014, 5:17 p.m. UTC | #1
On Tue, 2 Dec 2014 17:45:10 +0100
=?UTF-8?q?Pavel=20=C5=A0imerda?=  <psimerda@redhat.com> wrote:

> Just print the help when "ip route del" is called without any other
> arguments.
> 
> Resolves:
> 
>  * https://bugzilla.redhat.com/show_bug.cgi?id=997965
> 
> Signed-off-by: Pavel Šimerda <psimerda@redhat.com>
> ---
>  ip/iproute.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ip/iproute.c b/ip/iproute.c
> index d77b1e3..c171f29 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -975,6 +975,9 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
>  		argc--; argv++;
>  	}
>  
> +	if (!dst_ok)
> +		usage();
> +
>  	if (d || nhs_ok)  {
>  		int idx;
>  

Good catch. Applied
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ip/iproute.c b/ip/iproute.c
index d77b1e3..c171f29 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -975,6 +975,9 @@  static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
 		argc--; argv++;
 	}
 
+	if (!dst_ok)
+		usage();
+
 	if (d || nhs_ok)  {
 		int idx;