From 29bc2c483386c47c2fc7094e7f4e1cfd0a13a21b Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Fri, 31 Oct 2003 16:32:12 +0000 Subject: [PATCH] do not insert a dest option header (even specified by a user) that should be placed before a routing header, unless a routing header really exists. Obtained from: KAME --- sys/netinet6/ip6_output.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index d916434f2d5..bbb7a430415 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -214,7 +214,19 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp, inp) /* Hop-by-Hop options header */ MAKE_EXTHDR(opt->ip6po_hbh, &exthdrs.ip6e_hbh); /* Destination options header(1st part) */ - MAKE_EXTHDR(opt->ip6po_dest1, &exthdrs.ip6e_dest1); + if (opt->ip6po_rthdr) { + /* + * Destination options header(1st part) + * This only makes sence with a routing header. + * See Section 9.2 of RFC 3542. + * Disabling this part just for MIP6 convenience is + * a bad idea. We need to think carefully about a + * way to make the advanced API coexist with MIP6 + * options, which might automatically be inserted in + * the kernel. + */ + MAKE_EXTHDR(opt->ip6po_dest1, &exthdrs.ip6e_dest1); + } /* Routing header */ MAKE_EXTHDR(opt->ip6po_rthdr, &exthdrs.ip6e_rthdr); /* Destination options header(2nd part) */