]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip xfrm state: Allow different selector family
authorThomas Egerer <hakke_007@gmx.de>
Sun, 17 Mar 2013 00:56:01 +0000 (00:56 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 18 Mar 2013 17:23:00 +0000 (10:23 -0700)
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 <hakke_007@gmx.de>
ip/xfrm_state.c

index 35957bdde621a7407db709123da5bb5670f659c6..6ff5b51fd06e3d59ee11ae568a9424775acb7ae8 100644 (file)
@@ -294,7 +294,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);