remove the ip6r0_addr and ip6r0_slmap members from ip6_rthdr0{}
according to rfc2292bis. Obtained from: KAME
This commit is contained in:
parent
5434eaa208
commit
c302f5bc07
@ -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 */
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user