1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

remove the ip6r0_addr and ip6r0_slmap members from ip6_rthdr0{}

according to rfc2292bis.

Obtained from:	KAME
This commit is contained in:
Hajimu UMEMOTO 2003-10-24 20:37:05 +00:00
parent 5434eaa208
commit c302f5bc07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121478
2 changed files with 8 additions and 7 deletions

View File

@ -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 */

View File

@ -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;