From patchwork Tue Dec 2 16:45:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pavel Simerda X-Patchwork-Id: 416919 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D70FE140079 for ; Wed, 3 Dec 2014 03:52:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932396AbaLBQwJ (ORCPT ); Tue, 2 Dec 2014 11:52:09 -0500 Received: from fox.pavlix.net ([84.246.161.104]:38340 "EHLO fox.pavlix.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932252AbaLBQwG (ORCPT ); Tue, 2 Dec 2014 11:52:06 -0500 X-Greylist: delayed 413 seconds by postgrey-1.27 at vger.kernel.org; Tue, 02 Dec 2014 11:52:06 EST Received: from mole.pavlix.net (unknown [84.246.161.87]) by fox.pavlix.net (Postfix) with ESMTPSA id 0046C1765353; Tue, 2 Dec 2014 17:45:11 +0100 (CET) Date: Tue, 2 Dec 2014 17:45:10 +0100 From: =?us-ascii?B?PT9VVEYtOD9xP1BhdmVsPTIwPUM1PUEwaW1lcmRhPz0=?= To: netdev@vger.kernel.org Cc: Stephen Hemminger Subject: [PATCH iproute2] ip route: don't assume default route Message-ID: <20141202164510.GA9005@mole.pavlix.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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;