From 5ff809ec06c9bb243aa0c7a062e9814b50a0163e Mon Sep 17 00:00:00 2001 From: roykingz Date: Mon, 21 Aug 2023 16:36:46 +0800 Subject: [PATCH 1/2] dpvs: fix cfgfile parser malloc problem --- src/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser.c b/src/parser.c index 24c800ec8..6ac4313e2 100644 --- a/src/parser.c +++ b/src/parser.c @@ -404,8 +404,8 @@ void *set_value(vector_t tokens) strncat(alloc, str, strlen(str)); } } else { - alloc = MALLOC(sizeof(char *) * (size + 1)); - memcpy(alloc, str, size); + alloc = MALLOC(sizeof(char) * (size + 1)); + memcpy(alloc, str, size + 1); } return alloc; From 279a549fe618f342688ccea0cee8f42a86e96a3f Mon Sep 17 00:00:00 2001 From: roykingz Date: Mon, 21 Aug 2023 16:57:33 +0800 Subject: [PATCH 2/2] ipvsadm: fix icmpv6 option and improve help message --- tools/ipvsadm/ipvsadm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ipvsadm/ipvsadm.c b/tools/ipvsadm/ipvsadm.c index 0c29b36b4..89ebc3d8e 100644 --- a/tools/ipvsadm/ipvsadm.c +++ b/tools/ipvsadm/ipvsadm.c @@ -665,6 +665,7 @@ parse_options(int argc, char **argv, struct ipvs_command_entry *ce, case 't': case 'u': case 'q': + case '1': set_option(options, OPT_SERVICE); if (c == 't') { ce->dpvs_svc.proto = IPPROTO_TCP; @@ -1721,7 +1722,10 @@ static void usage_exit(const char *program, const int exit_status) " --dest-check CHECK_CONF config health check, inhibit scheduling to failed backends\n" " CHECK_CONF:=disable|default(passive)|DETAIL(passive)|tcp|udp|ping, DETAIL:=UPDOWN|DOWNONLY\n" " UPDOWN:=down_retry,up_confirm,down_wait,inhibit_min-inhibit_max, for example, the default is 1,1,3s,5-3600s\n" - " DOWNONLY:=down_retry,down_wait, for example, --dest-check=1,3s\n", + " DOWNONLY:=down_retry,down_wait, for example, --dest-check=1,3s\n" + " --laddr -z local-ip local IP\n" + " --blklst -k blacklist-ip blacklist IP for specific service\n" + " --whtlst -2 whitelist-ip whitelist IP for specific service\n", DEF_SCHED); exit(exit_status);