]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
ip xfrm policy: allow different tmpl family
authorAlex Badea <abadea@ixiacom.com>
Mon, 11 Jan 2010 15:24:04 +0000 (17:24 +0200)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Thu, 21 Jan 2010 18:11:23 +0000 (10:11 -0800)
Allow tmpl IP addresses to have a different family than
selector addresses.  This is useful in conjunction with
XFRM_STATE_AF_UNSPEC.

Signed-off-by: Alex Badea <abadea@ixiacom.com>
ip/xfrm_policy.c

index 11116e5fef16c1be9ffc39375e6cd39f18795d52..27884773fc1aed14a004e66d4ec26ffe5de83720 100644 (file)
@@ -201,10 +201,10 @@ static int xfrm_tmpl_parse(struct xfrm_user_tmpl *tmpl,
                                break;
                        }
                        idp = *argv;
+                       preferred_family = AF_UNSPEC;
                        xfrm_id_parse(&tmpl->saddr, &tmpl->id, &tmpl->family,
                                      0, &argc, &argv);
-                       if (preferred_family == AF_UNSPEC)
-                               preferred_family = tmpl->family;
+                       preferred_family = tmpl->family;
                }
 
                if (!NEXT_ARG_OK())