diff options
-rw-r--r-- | sys/netinet/ip6.h | 5 | ||||
-rw-r--r-- | sys/netinet6/ip6_output.c | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sys/netinet/ip6.h b/sys/netinet/ip6.h index ae66264..8a54231 100644 --- a/sys/netinet/ip6.h +++ b/sys/netinet/ip6.h @@ -181,9 +181,8 @@ struct ip6_rthdr0 { u_int8_t ip6r0_len; /* length in units of 8 octets */ u_int8_t ip6r0_type; /* always zero */ u_int8_t ip6r0_segleft; /* segments left */ - u_int8_t ip6r0_reserved; /* reserved field */ - u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */ - struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */ + u_int32_t ip6r0_reserved; /* reserved field */ + /* followed by up to 127 struct in6_addr */ } __attribute__((__packed__)); /* Fragment header */ diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index b4859ec..0e20f6c 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -478,17 +478,19 @@ skip_ipsec2:; (struct ip6_rthdr *)(mtod(exthdrs.ip6e_rthdr, struct ip6_rthdr *)); struct ip6_rthdr0 *rh0; + struct in6_addr *addrs; finaldst = ip6->ip6_dst; switch (rh->ip6r_type) { case IPV6_RTHDR_TYPE_0: rh0 = (struct ip6_rthdr0 *)rh; - ip6->ip6_dst = rh0->ip6r0_addr[0]; - bcopy((caddr_t)&rh0->ip6r0_addr[1], - (caddr_t)&rh0->ip6r0_addr[0], + addrs = (struct in6_addr *)(rh + 1); + + ip6->ip6_dst = *addrs; + bcopy((caddr_t)(addrs + 1), (caddr_t)addrs, sizeof(struct in6_addr)*(rh0->ip6r0_segleft - 1) ); - rh0->ip6r0_addr[rh0->ip6r0_segleft - 1] = finaldst; + *(addrs + rh0->ip6r0_segleft - 1) = finaldst; break; default: /* is it possible? */ error = EINVAL; |