All of lore.kernel.org
 help / color / mirror / Atom feed
* [iproute PATCH] ipl2tp: Print help even on systems without l2tp support
@ 2016-02-24  8:12 Phil Sutter
  2016-03-02 17:33 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2016-02-24  8:12 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 ip/ipl2tp.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
index f050880eef02a..3e3b21ddfb7fe 100644
--- a/ip/ipl2tp.c
+++ b/ip/ipl2tp.c
@@ -720,6 +720,9 @@ static int do_show(int argc, char **argv)
 
 int do_ipl2tp(int argc, char **argv)
 {
+	if (argc < 1 || !matches(*argv, "help"))
+		usage();
+
 	if (genl_family < 0) {
 		if (rtnl_open_byproto(&genl_rth, 0, NETLINK_GENERIC) < 0) {
 			fprintf(stderr, "Cannot open generic netlink socket\n");
@@ -731,9 +734,6 @@ int do_ipl2tp(int argc, char **argv)
 			exit(1);
 	}
 
-	if (argc < 1)
-		usage();
-
 	if (matches(*argv, "add") == 0)
 		return do_add(argc-1, argv+1);
 	if (matches(*argv, "delete") == 0)
@@ -742,8 +742,6 @@ int do_ipl2tp(int argc, char **argv)
 	    matches(*argv, "lst") == 0 ||
 	    matches(*argv, "list") == 0)
 		return do_show(argc-1, argv+1);
-	if (matches(*argv, "help") == 0)
-		usage();
 
 	fprintf(stderr, "Command \"%s\" is unknown, try \"ip l2tp help\".\n", *argv);
 	exit(-1);
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [iproute PATCH] ipl2tp: Print help even on systems without l2tp support
  2016-02-24  8:12 [iproute PATCH] ipl2tp: Print help even on systems without l2tp support Phil Sutter
@ 2016-03-02 17:33 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2016-03-02 17:33 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev

On Wed, 24 Feb 2016 09:12:47 +0100
Phil Sutter <phil@nwl.cc> wrote:

> Signed-off-by: Phil Sutter <phil@nwl.cc>

Applied

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-02 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-24  8:12 [iproute PATCH] ipl2tp: Print help even on systems without l2tp support Phil Sutter
2016-03-02 17:33 ` Stephen Hemminger

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.