aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorMasahide NAKAMURA <nakam@linux-ipv6.org>2006-08-24 01:54:07 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 18:08:37 -0400
commit64d9fdda8e1bdf416b2d9203c3ad9c249ea301be (patch)
tree875d2925a44cdacd0adc1f1ccfbd3f06cd4d0b69 /net/ipv6
parent58c949d1b9551f3e4ba9dde4aeda341ecf5e42b5 (diff)
[XFRM] IPV6: Support Mobile IPv6 extension headers sorting.
Support Mobile IPv6 extension headers sorting for two transformation policies. Mobile IPv6 extension headers should be placed after IPsec transport mode, but before transport AH when outbound. Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/xfrm6_state.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index e0b8f3c5caa2..6269584e610e 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -173,7 +173,19 @@ __xfrm6_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n)
173 if (j == n) 173 if (j == n)
174 goto end; 174 goto end;
175 175
176 /* XXX: Rule 2: select MIPv6 RO or inbound trigger */ 176 /* Rule 2: select MIPv6 RO or inbound trigger */
177#ifdef CONFIG_IPV6_MIP6
178 for (i = 0; i < n; i++) {
179 if (src[i] &&
180 (src[i]->props.mode == XFRM_MODE_ROUTEOPTIMIZATION ||
181 src[i]->props.mode == XFRM_MODE_IN_TRIGGER)) {
182 dst[j++] = src[i];
183 src[i] = NULL;
184 }
185 }
186 if (j == n)
187 goto end;
188#endif
177 189
178 /* Rule 3: select IPsec transport AH */ 190 /* Rule 3: select IPsec transport AH */
179 for (i = 0; i < n; i++) { 191 for (i = 0; i < n; i++) {
@@ -226,7 +238,19 @@ __xfrm6_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n)
226 if (j == n) 238 if (j == n)
227 goto end; 239 goto end;
228 240
229 /* XXX: Rule 2: select MIPv6 RO or inbound trigger */ 241 /* Rule 2: select MIPv6 RO or inbound trigger */
242#ifdef CONFIG_IPV6_MIP6
243 for (i = 0; i < n; i++) {
244 if (src[i] &&
245 (src[i]->mode == XFRM_MODE_ROUTEOPTIMIZATION ||
246 src[i]->mode == XFRM_MODE_IN_TRIGGER)) {
247 dst[j++] = src[i];
248 src[i] = NULL;
249 }
250 }
251 if (j == n)
252 goto end;
253#endif
230 254
231 /* Rule 3: select IPsec tunnel */ 255 /* Rule 3: select IPsec tunnel */
232 for (i = 0; i < n; i++) { 256 for (i = 0; i < n; i++) {