linma / rpms / iproute

Forked from rpms/iproute 4 years ago
Clone

Blame SOURCES/0090-ipl2tp-Print-help-even-on-systems-without-l2tp-suppo.patch

049c96
From 4112b882e90a2338ecc9ad83a8b01d77725ab52d Mon Sep 17 00:00:00 2001
049c96
From: Phil Sutter <psutter@redhat.com>
049c96
Date: Mon, 7 Mar 2016 20:33:46 +0100
049c96
Subject: [PATCH] ipl2tp: Print help even on systems without l2tp support
049c96
049c96
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1251186
049c96
Upstream Status: iproute2.git commit e897776690aec
049c96
049c96
commit e897776690aec728f9033eef146783d3a3d48033
049c96
Author: Phil Sutter <phil@nwl.cc>
049c96
Date:   Wed Feb 24 09:12:47 2016 +0100
049c96
049c96
    ipl2tp: Print help even on systems without l2tp support
049c96
049c96
    Signed-off-by: Phil Sutter <phil@nwl.cc>
049c96
---
049c96
 ip/ipl2tp.c | 8 +++-----
049c96
 1 file changed, 3 insertions(+), 5 deletions(-)
049c96
049c96
diff --git a/ip/ipl2tp.c b/ip/ipl2tp.c
049c96
index 2f7c9bf..92e15c5 100644
049c96
--- a/ip/ipl2tp.c
049c96
+++ b/ip/ipl2tp.c
049c96
@@ -719,6 +719,9 @@ static int do_show(int argc, char **argv)
049c96
 
049c96
 int do_ipl2tp(int argc, char **argv)
049c96
 {
049c96
+	if (argc < 1 || !matches(*argv, "help"))
049c96
+		usage();
049c96
+
049c96
 	if (genl_family < 0) {
049c96
 		if (rtnl_open_byproto(&genl_rth, 0, NETLINK_GENERIC) < 0) {
049c96
 			fprintf(stderr, "Cannot open generic netlink socket\n");
049c96
@@ -730,9 +733,6 @@ int do_ipl2tp(int argc, char **argv)
049c96
 			exit(1);
049c96
 	}
049c96
 
049c96
-	if (argc < 1)
049c96
-		usage();
049c96
-
049c96
 	if (matches(*argv, "add") == 0)
049c96
 		return do_add(argc-1, argv+1);
049c96
 	if (matches(*argv, "delete") == 0)
049c96
@@ -741,8 +741,6 @@ int do_ipl2tp(int argc, char **argv)
049c96
 	    matches(*argv, "lst") == 0 ||
049c96
 	    matches(*argv, "list") == 0)
049c96
 		return do_show(argc-1, argv+1);
049c96
-	if (matches(*argv, "help") == 0)
049c96
-		usage();
049c96
 
049c96
 	fprintf(stderr, "Command \"%s\" is unknown, try \"ip l2tp help\".\n", *argv);
049c96
 	exit(-1);
049c96
-- 
049c96
1.8.3.1
049c96