Upstream commit 90884c62 ("xl2tpd-control refactoring") introduced in
1.3.16 changed command names
The l2tp protocol handler part was from @danvd in pull request
openwrt/packages#13866
Fixes f07319d6
("xl2tpd: bump to version 1.3.16")
Ref: https://github.com/openwrt/packages/pull/13866
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
lilik-openwrt-22.03
@ -0,0 +1,26 @@ | |||||
From f94ffac18ddfe72b00ec849a34c71d6bc5bcb767 Mon Sep 17 00:00:00 2001 | |||||
From: Yousong Zhou <yszhou4tech@gmail.com> | |||||
Date: Thu, 12 Nov 2020 14:31:23 +0800 | |||||
Subject: [PATCH] xl2tpd-control: fix out-of-bound access | |||||
It can cause segfault when presented with unknown command name | |||||
Fixes 90884c62 ("xl2tpd-control refactoring") | |||||
--- | |||||
xl2tpd-control.c | 3 ++- | |||||
1 file changed, 2 insertions(+), 1 deletion(-) | |||||
diff --git a/xl2tpd-control.c b/xl2tpd-control.c | |||||
index 1e87c93..d1df0f6 100644 | |||||
--- a/xl2tpd-control.c | |||||
+++ b/xl2tpd-control.c | |||||
@@ -83,7 +83,8 @@ struct command_t commands[] = { | |||||
{"available", &command_available, TUNNEL_NOT_REQUIRED}, | |||||
{"add-lns", &command_add_lns, TUNNEL_REQUIRED}, | |||||
{"status-lns", &command_status_lns, TUNNEL_REQUIRED}, | |||||
- {"remove-lns", &command_remove_lns, TUNNEL_REQUIRED} | |||||
+ {"remove-lns", &command_remove_lns, TUNNEL_REQUIRED}, | |||||
+ {}, | |||||
}; | |||||
void usage() |
@ -0,0 +1,22 @@ | |||||
From 06bd6af97055071be5ed0f83a808032688a503db Mon Sep 17 00:00:00 2001 | |||||
From: Yousong Zhou <yszhou4tech@gmail.com> | |||||
Date: Thu, 12 Nov 2020 14:33:05 +0800 | |||||
Subject: [PATCH] xl2tpd-control: fix typo in usage | |||||
--- | |||||
xl2tpd-control.c | 2 +- | |||||
1 file changed, 1 insertion(+), 1 deletion(-) | |||||
diff --git a/xl2tpd-control.c b/xl2tpd-control.c | |||||
index d1df0f6..2e683c8 100644 | |||||
--- a/xl2tpd-control.c | |||||
+++ b/xl2tpd-control.c | |||||
@@ -96,7 +96,7 @@ void usage() | |||||
" --help show this help message\n\n" | |||||
"List of supported commands:\n" | |||||
"add-lac, status-lac, remove-lac, connect-lac, disconnect-lac\n" | |||||
- "add-lns, status-lns, remove-lns, avaliable\n\n" | |||||
+ "add-lns, status-lns, remove-lns, available\n\n" | |||||
"See xl2tpd-control(8) man page for more details.\n"); | |||||
} | |||||