aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-07-31 05:04:32 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-31 05:28:32 -0400
commit196b003620f1ee8d0fc63f13f341187d63c1dc0a (patch)
tree2710ea74dab44caa9d3405fc6d95a2663f253f16
parentb8ed601cefe7a4014b93560bd846caf44f25b1c1 (diff)
[IPSEC]: Ensure that state inner family is set
Similar to the issue we had with template families which specified the inner families of policies, we need to set the inner families of states as the main xfrm user Openswan leaves it as zero. af_key is unaffected because the inner family is set by it and not the KM. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/xfrm/xfrm_user.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index c06883bf620e..61339e17a0f5 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -322,6 +322,13 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info *
322 x->props.family = p->family; 322 x->props.family = p->family;
323 memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); 323 memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr));
324 x->props.flags = p->flags; 324 x->props.flags = p->flags;
325
326 /*
327 * Set inner address family if the KM left it as zero.
328 * See comment in validate_tmpl.
329 */
330 if (!x->sel.family)
331 x->sel.family = p->family;
325} 332}
326 333
327/* 334/*