aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2008-11-04 17:49:19 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-04 17:49:19 -0500
commit79654a7698195fa043063092f5c1ca5245276fba (patch)
tree28089eb142f4d67e241db0bf01990998e922c028 /net
parentbbb770e7ab9a436752babfc8765e422d7481be1f (diff)
xfrm: Have af-specific init_tempsel() initialize family field of temporary selector
While adding MIGRATE support to strongSwan, Andreas Steffen noticed that the selectors provided in XFRM_MSG_ACQUIRE have their family field uninitialized (those in MIGRATE do have their family set). Looking at the code, this is because the af-specific init_tempsel() (called via afinfo->init_tempsel() in xfrm_init_tempsel()) do not set the value. Reported-by: Andreas Steffen <andreas.steffen@strongswan.org> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Arnaud Ebalard <arno@natisbad.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/xfrm4_state.c1
-rw-r--r--net/ipv6/xfrm6_state.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index 07735ed280d7..55dc6beab9aa 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -33,6 +33,7 @@ __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl,
33 x->sel.dport_mask = htons(0xffff); 33 x->sel.dport_mask = htons(0xffff);
34 x->sel.sport = xfrm_flowi_sport(fl); 34 x->sel.sport = xfrm_flowi_sport(fl);
35 x->sel.sport_mask = htons(0xffff); 35 x->sel.sport_mask = htons(0xffff);
36 x->sel.family = AF_INET;
36 x->sel.prefixlen_d = 32; 37 x->sel.prefixlen_d = 32;
37 x->sel.prefixlen_s = 32; 38 x->sel.prefixlen_s = 32;
38 x->sel.proto = fl->proto; 39 x->sel.proto = fl->proto;
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index 89884a4f23aa..60c78cfc2737 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -34,6 +34,7 @@ __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl,
34 x->sel.dport_mask = htons(0xffff); 34 x->sel.dport_mask = htons(0xffff);
35 x->sel.sport = xfrm_flowi_sport(fl); 35 x->sel.sport = xfrm_flowi_sport(fl);
36 x->sel.sport_mask = htons(0xffff); 36 x->sel.sport_mask = htons(0xffff);
37 x->sel.family = AF_INET6;
37 x->sel.prefixlen_d = 128; 38 x->sel.prefixlen_d = 128;
38 x->sel.prefixlen_s = 128; 39 x->sel.prefixlen_s = 128;
39 x->sel.proto = fl->proto; 40 x->sel.proto = fl->proto;