* [PATCH iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault
@ 2023-03-31 13:18 Sabrina Dubroca
2023-03-31 13:29 ` Nicolas Dichtel
2023-04-05 2:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Sabrina Dubroca @ 2023-03-31 13:18 UTC (permalink / raw)
To: netdev; +Cc: dsahern, stephen, Sabrina Dubroca, nicolas.dichtel
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>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault
2023-03-31 13:18 [PATCH iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault Sabrina Dubroca
@ 2023-03-31 13:29 ` Nicolas Dichtel
2023-04-05 2:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dichtel @ 2023-03-31 13:29 UTC (permalink / raw)
To: Sabrina Dubroca, netdev; +Cc: dsahern, stephen
Le 31/03/2023 à 15:18, Sabrina Dubroca a écrit :
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault
2023-03-31 13:18 [PATCH iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault Sabrina Dubroca
2023-03-31 13:29 ` Nicolas Dichtel
@ 2023-04-05 2:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-05 2:20 UTC (permalink / raw)
To: Sabrina Dubroca; +Cc: netdev, dsahern, stephen, nicolas.dichtel
Hello:
This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber•org>:
On Fri, 31 Mar 2023 15:18:25 +0200 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=009739adb92c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-05 2:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31 13:18 [PATCH iproute2] ip-xfrm: accept "allow" as action in ip xfrm policy setdefault Sabrina Dubroca
2023-03-31 13:29 ` Nicolas Dichtel
2023-04-05 2:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox