diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2023-03-31 15:18:25 +0200 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2023-04-04 18:31:58 -0700 |
commit | 009739adb92cfaab54e9e3f31ecdd7dcf4082e0c (patch) | |
tree | 6858650b0b0f728a86a8501e730000ac9894563c /ip | |
parent | 73d294dfe63f2fadd52faa39c0079b44bfbe24ed (diff) | |
download | iproute2-009739adb92cfaab54e9e3f31ecdd7dcf4082e0c.tar.gz |
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@queasysnail.net>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'ip')
-rw-r--r-- | ip/xfrm_policy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c index be2235ca..8687ced3 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; } |