diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2008-07-10 23:55:37 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-10 23:55:37 (GMT) |
commit | ccf9b3b83d0e56fbf20c00a08b15031ce13204a7 (patch) | |
tree | ecefe07436ac172dc99deb6e77e7a7cfd5c81155 /net/xfrm/xfrm_user.c | |
parent | 0ce28553cc018be5022f51e67c87997f7271534e (diff) | |
download | linux-fsl-qoriq-ccf9b3b83d0e56fbf20c00a08b15031ce13204a7.tar.xz |
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.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index b976d9e..04c4150 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -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; - } /* |