Skip to content

Commit

Permalink
do not insert a dest option header (even specified by a user) that
Browse files Browse the repository at this point in the history
should be placed before a routing header, unless a routing header
really exists.
  • Loading branch information
jinmei committed Jan 7, 2000
1 parent 0fb603c commit b43f997
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions kame/sys/netinet6/ip6_output.c
Expand Up @@ -226,8 +226,13 @@ ip6_output(m0, opt, ro, flags, im6o, ifpp)
if (opt) {
/* 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.
*/
MAKE_EXTHDR(opt->ip6po_dest1, &exthdrs.ip6e_dest1);
}
/* Routing header */
MAKE_EXTHDR(opt->ip6po_rthdr, &exthdrs.ip6e_rthdr);
/* Destination options header(2nd part) */
Expand Down Expand Up @@ -3098,7 +3103,9 @@ ip6_optlen(in6p)
(((struct ip6_ext *)(x)) ? (((struct ip6_ext *)(x))->ip6e_len + 1) << 3 : 0)

len += elen(in6p->in6p_outputopts->ip6po_hbh);
len += elen(in6p->in6p_outputopts->ip6po_dest1);
if (in6p->in6p_outputopts->ip6po_rthdr)
/* dest1 is valid with rthdr only */
len += elen(in6p->in6p_outputopts->ip6po_dest1);
len += elen(in6p->in6p_outputopts->ip6po_rthdr);
len += elen(in6p->in6p_outputopts->ip6po_dest2);
return len;
Expand Down

0 comments on commit b43f997

Please sign in to comment.