From 2ecf5196e30610169d33ac5c6873f6ab5c8f7743 Mon Sep 17 00:00:00 2001 From: ume Date: Fri, 31 Oct 2003 16:32:12 +0000 Subject: 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(-) (limited to 'sys/netinet6/ip6_output.c') diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index d916434..bbb7a43 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) */ -- cgit v1.1