netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] ip xfrm policy: allow different tmpl family
@ 2010-01-11 15:24 Alex Badea
  2010-01-21 18:11 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Badea @ 2010-01-11 15:24 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, Alex Badea

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>
---

Rather than resetting preferred_family unconditionally, we could
have a new optional keyword for TMPL, e.g. "ip xfrm policy add ...
tmpl unspec mode tunnel ...".  Let me know if that would be preferred.

 ip/xfrm_policy.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index 11116e5..2788477 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())
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-21 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 15:24 [PATCH iproute2] ip xfrm policy: allow different tmpl family Alex Badea
2010-01-21 18:11 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).