[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <dc8c3fcd81a212e47547ae59ee6857ce25048ddd.1680268153.git.sd@queasysnail.net>
Date: Fri, 31 Mar 2023 15:18:25 +0200
From: Sabrina Dubroca <sd@...asysnail.net>
To: netdev@...r.kernel.org
Cc: dsahern@...il.com, stephen@...workplumber.org,
Sabrina Dubroca <sd@...asysnail.net>, nicolas.dichtel@...nd.com
Subject: [PATCH iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault
The help text claims that setdefault takes ACTION values, ie block |
allow. In reality, xfrm_str_to_policy takes block | accept.
We could also fix that by changing the help text/manpage, but then
it'd be frustrating to have multiple ACTION with similar values used
in different subcommands.
I'm not changing the output in xfrm_policy_to_str because some
userspace somewhere probably depends on the "accept" value.
Fixes: 76b30805f9f6 ("xfrm: enable to manage default policies")
Signed-off-by: Sabrina Dubroca <sd@...asysnail.net>
---
ip/xfrm_policy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index be2235ca949d..8687ced35a25 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -1141,7 +1141,8 @@ static int xfrm_str_to_policy(char *name, uint8_t *policy)
if (strcmp(name, "block") == 0) {
*policy = XFRM_USERPOLICY_BLOCK;
return 0;
- } else if (strcmp(name, "accept") == 0) {
+ } else if (strcmp(name, "accept") == 0 ||
+ strcmp(name, "allow") == 0) {
*policy = XFRM_USERPOLICY_ACCEPT;
return 0;
}
--
2.38.1
Powered by blists - more mailing lists