ip xfrm state: Allow different selector family
Subsystems (2)
PATCH 1/1 ip xfrm state: Allow different selector family
Do not enforce the selector of a state to have the same address family as the id. This makes it possible to configure inter family states.
Signed-off-by Thomas Egerer <[email protected]>
--- ip/xfrm_state.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
ip/xfrm_state.c +2 -0
@@ -300,7 +300,9 @@ static int xfrm_state_modify(int cmd, unsigned flags, int argc, char **argv)xfrm_state_flag_parse (&req.xsinfo.flags, &argc, &argv); }else if (strcmp (*argv,"sel" ) ==0 ) {NEXT_ARG (); + preferred_family =AF_UNSPEC ;xfrm_selector_parse (&req.xsinfo.sel, &argc, &argv); + preferred_family = req.xsinfo.sel; }else if (strcmp (*argv,"limit" ) ==0 ) {NEXT_ARG ();xfrm_lifetime_cfg_parse (&req.xsinfo.lft, &argc, &argv);
My previous commit introduced a patch to allow for states with different ip address families for selector and id. The must have somehow been a mixup of the patch I tested and the one I send, so the patch sent breaks the iproute2 build. This patch fixes this. My apologies.
Signed-off-by Thomas Egerer <[email protected]>
---
Hi Stephen, *,
my sincere apologies for breaking the build. But I somehow build and tested one commit and sent the wrong one to the list. The assignment was wrong. This commit fixes this bug. My bad,
Thomas
ip/xfrm_state.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
0001-ip-xfrm-state-Fix-assignment-of-preferred_family.patch
ip/xfrm_state.c +1 -1
@@ -296,7 +296,7 @@ static int xfrm_state_modify(int cmd, unsigned flags, int argc, char **argv)NEXT_ARG (); preferred_family =AF_UNSPEC ;xfrm_selector_parse (&req.xsinfo.sel, &argc, &argv); - preferred_family = req.xsinfo.sel; + preferred_family = req.xsinfo.sel.family; }else if (strcmp (*argv,"limit" ) ==0 ) {NEXT_ARG ();xfrm_lifetime_cfg_parse (&req.xsinfo.lft, &argc, &argv);