From: Alex Badea Date: Mon, 11 Jan 2010 15:24:04 +0000 (+0200) Subject: ip xfrm policy: allow different tmpl family X-Git-Tag: v2.6.33~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6e0b60f2a3d2720d4d9d6d0a50e3b48deea45e4;p=thirdparty%2Fiproute2.git ip xfrm policy: allow different tmpl family 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 --- diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c index 11116e5fe..27884773f 100644 --- a/ip/xfrm_policy.c +++ b/ip/xfrm_policy.c @@ -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())