xfrm: Add a XFRM_STATE_AF_UNSPEC flag to xfrm_usersa_info
Subsystems (3)
Steffen Klassert
maintainerPATCH 1/1 xfrm: Add a XFRM_STATE_AF_UNSPEC flag to xfrm_usersa_info
Add a XFRM_STATE_AF_UNSPEC flag to handle the AF_UNSPEC behavior for the selector family. Userspace applications can set this flag to leave the selector family of the xfrm_state unspecified. This can be used to to handle inter family tunnels if the selector is not set from userspace.
--- include/linux/xfrm.h | 1 + net/xfrm/xfrm_user.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/xfrm.h +1 -0
@@ -339,6 +339,7 @@ struct xfrm_usersa_info {#define XFRM_STATE_NOPMTUDISC 4#define XFRM_STATE_WILDRECV 8#define XFRM_STATE_ICMP 16 +#define XFRM_STATE_AF_UNSPEC 32 };struct xfrm_usersa_id {
net/xfrm/xfrm_user.c +1 -2
@@ -277,9 +277,8 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info *memcpy (&x->props.saddr, &p->saddr,sizeof (x->props.saddr)); x->props.flags = p->flags; -if (!x->sel.family) +if (!x->sel.family && !(p->flags &XFRM_STATE_AF_UNSPEC )) x->sel.family = p->family; - }/*
Signature · 1 line
1.5.3
Quoted 7 lines · Steffen Klassert
Add a
XFRM_STATE_AF_UNSPECflag to handle theAF_UNSPECbehavior for the selector family. Userspace applications can set this flag to leave the selector family of thexfrm_stateunspecified. This can be used to to handle inter family tunnels if the selector is not set from userspace.Signed-off-by Steffen Klassert <[email protected]>
Thanks,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtFrom: Herbert Xu <[email protected]>
Date: Thu, 10 Jul 2008 20:31:54 +0800
Quoted 10 lines · Steffen Klassert
Quoted 7 lines
Add a
XFRM_STATE_AF_UNSPECflag to handle theAF_UNSPECbehavior for the selector family. Userspace applications can set this flag to leave the selector family of thexfrm_stateunspecified. This can be used to to handle inter family tunnels if the selector is not set from userspace.Signed-off-by Steffen Klassert <[email protected]>Acked-by Herbert Xu <[email protected]>
Applied, thanks!