Commit e6df439b authored by Brian Haley's avatar Brian Haley Committed by David S. Miller

[IPV6]: Bring Type 0 routing header in-line with rfc3542.

Signed-off-by: default avatarBrian Haley <brian.haley@hp.com>
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3874b98c
...@@ -68,7 +68,7 @@ struct ipv6_opt_hdr { ...@@ -68,7 +68,7 @@ struct ipv6_opt_hdr {
struct rt0_hdr { struct rt0_hdr {
struct ipv6_rt_hdr rt_hdr; struct ipv6_rt_hdr rt_hdr;
__u32 bitmap; /* strict/loose bit map */ __u32 reserved;
struct in6_addr addr[0]; struct in6_addr addr[0];
#define rt0_type rt_hdr.type #define rt0_type rt_hdr.type
......
...@@ -406,8 +406,7 @@ ipv6_invert_rthdr(struct sock *sk, struct ipv6_rt_hdr *hdr) ...@@ -406,8 +406,7 @@ ipv6_invert_rthdr(struct sock *sk, struct ipv6_rt_hdr *hdr)
memcpy(opt->srcrt, hdr, sizeof(*hdr)); memcpy(opt->srcrt, hdr, sizeof(*hdr));
irthdr = (struct rt0_hdr*)opt->srcrt; irthdr = (struct rt0_hdr*)opt->srcrt;
/* Obsolete field, MBZ, when originated by us */ irthdr->reserved = 0;
irthdr->bitmap = 0;
opt->srcrt->segments_left = n; opt->srcrt->segments_left = n;
for (i=0; i<n; i++) for (i=0; i<n; i++)
memcpy(irthdr->addr+i, rthdr->addr+(n-1-i), 16); memcpy(irthdr->addr+i, rthdr->addr+(n-1-i), 16);
......
...@@ -161,8 +161,8 @@ match(const struct sk_buff *skb, ...@@ -161,8 +161,8 @@ match(const struct sk_buff *skb,
((rtinfo->hdrlen == hdrlen) ^ ((rtinfo->hdrlen == hdrlen) ^
!!(rtinfo->invflags & IP6T_RT_INV_LEN)))); !!(rtinfo->invflags & IP6T_RT_INV_LEN))));
DEBUGP("res %02X %02X %02X ", DEBUGP("res %02X %02X %02X ",
(rtinfo->flags & IP6T_RT_RES), ((struct rt0_hdr *)rh)->bitmap, (rtinfo->flags & IP6T_RT_RES), ((struct rt0_hdr *)rh)->reserved,
!((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)rh)->bitmap))); !((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)rh)->reserved)));
ret = (rh != NULL) ret = (rh != NULL)
&& &&
...@@ -179,12 +179,12 @@ match(const struct sk_buff *skb, ...@@ -179,12 +179,12 @@ match(const struct sk_buff *skb,
!!(rtinfo->invflags & IP6T_RT_INV_TYP))); !!(rtinfo->invflags & IP6T_RT_INV_TYP)));
if (ret && (rtinfo->flags & IP6T_RT_RES)) { if (ret && (rtinfo->flags & IP6T_RT_RES)) {
u_int32_t *bp, _bitmap; u_int32_t *rp, _reserved;
bp = skb_header_pointer(skb, rp = skb_header_pointer(skb,
ptr + offsetof(struct rt0_hdr, bitmap), ptr + offsetof(struct rt0_hdr, reserved),
sizeof(_bitmap), &_bitmap); sizeof(_reserved), &_reserved);
ret = (*bp == 0); ret = (*rp == 0);
} }
DEBUGP("#%d ",rtinfo->addrnr); DEBUGP("#%d ",rtinfo->addrnr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment