From 9928890c1f94da58bf753ede937b7324f6832866 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Sat, 10 Sep 2005 11:26:34 +0900 Subject: [IPV6]: rearrange constants for new advanced API to solve conflicts. 64, 65 are already used in ip6_tables. Pointed out by Patrick McHardy . Signed-off-by: YOSHIFUJI Hideaki --- include/linux/in6.h | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'include/linux') diff --git a/include/linux/in6.h b/include/linux/in6.h index bd32b79d629..50cdc3ad61a 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h @@ -198,27 +198,29 @@ struct in6_flowlabel_req * MCAST_MSFILTER 48 */ -/* RFC3542 advanced socket options (50-67) */ -#define IPV6_RECVPKTINFO 50 -#define IPV6_PKTINFO 51 -#if 0 -#define IPV6_RECVPATHMTU 52 -#define IPV6_PATHMTU 53 -#define IPV6_DONTFRAG 54 -#define IPV6_USE_MIN_MTU 55 -#endif -#define IPV6_RECVHOPOPTS 56 -#define IPV6_HOPOPTS 57 -#if 0 -#define IPV6_RECVRTHDRDSTOPTS 58 /* Unused, see net/ipv6/datagram.c */ +/* + * Advanced API (RFC3542) (1) + * + * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c. + */ + +#define IPV6_RECVPKTINFO 49 +#define IPV6_PKTINFO 50 +#define IPV6_RECVHOPLIMIT 51 +#define IPV6_HOPLIMIT 52 +#define IPV6_RECVHOPOPTS 53 +#define IPV6_HOPOPTS 54 +#define IPV6_RTHDRDSTOPTS 55 +#define IPV6_RECVRTHDR 56 +#define IPV6_RTHDR 57 +#define IPV6_RECVDSTOPTS 58 +#define IPV6_DSTOPTS 59 +#if 0 /* not yet */ +#define IPV6_RECVPATHMTU 60 +#define IPV6_PATHMTU 61 +#define IPV6_DONTFRAG 62 +#define IPV6_USE_MIN_MTU 63 #endif -#define IPV6_RTHDRDSTOPTS 59 -#define IPV6_RECVRTHDR 60 -#define IPV6_RTHDR 61 -#define IPV6_RECVDSTOPTS 62 -#define IPV6_DSTOPTS 63 -#define IPV6_RECVHOPLIMIT 64 -#define IPV6_HOPLIMIT 65 #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 -- cgit v1.2.3-70-g09d2 From dd27466df9924706ae34639ce3f4f837875d45c1 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Sat, 10 Sep 2005 11:32:45 +0900 Subject: [IPV6]: Note values allocated for ip6_tables. To avoid future conflicts, add a note values allocated for ip6_tables. Signed-off-by: YOSHIFUJI Hideaki --- include/linux/in6.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/linux') diff --git a/include/linux/in6.h b/include/linux/in6.h index 50cdc3ad61a..304aaedea30 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h @@ -221,6 +221,20 @@ struct in6_flowlabel_req #define IPV6_DONTFRAG 62 #define IPV6_USE_MIN_MTU 63 #endif + +/* + * Netfilter + * + * Following socket options are used in ip6_tables; + * see include/linux/netfilter_ipv6/ip6_tables.h. + * + * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO 64 + * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES 65 + */ + +/* + * Advanced API (RFC3542) (2) + */ #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 -- cgit v1.2.3-70-g09d2 From e6df439b89dbf9eb977c2dc6f7b0644be3704df4 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Sat, 10 Sep 2005 00:15:06 -0700 Subject: [IPV6]: Bring Type 0 routing header in-line with rfc3542. Signed-off-by: Brian Haley Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- include/linux/ipv6.h | 2 +- net/ipv6/exthdrs.c | 3 +-- net/ipv6/netfilter/ip6t_rt.c | 14 +++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'include/linux') diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 6c5f7b39a4b..bb6f88e1406 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -68,7 +68,7 @@ struct ipv6_opt_hdr { struct rt0_hdr { struct ipv6_rt_hdr rt_hdr; - __u32 bitmap; /* strict/loose bit map */ + __u32 reserved; struct in6_addr addr[0]; #define rt0_type rt_hdr.type diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 47122728212..922549581ab 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c @@ -406,8 +406,7 @@ ipv6_invert_rthdr(struct sock *sk, struct ipv6_rt_hdr *hdr) memcpy(opt->srcrt, hdr, sizeof(*hdr)); irthdr = (struct rt0_hdr*)opt->srcrt; - /* Obsolete field, MBZ, when originated by us */ - irthdr->bitmap = 0; + irthdr->reserved = 0; opt->srcrt->segments_left = n; for (i=0; iaddr+i, rthdr->addr+(n-1-i), 16); diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c index a9526b773d2..2bb670037df 100644 --- a/net/ipv6/netfilter/ip6t_rt.c +++ b/net/ipv6/netfilter/ip6t_rt.c @@ -161,8 +161,8 @@ match(const struct sk_buff *skb, ((rtinfo->hdrlen == hdrlen) ^ !!(rtinfo->invflags & IP6T_RT_INV_LEN)))); DEBUGP("res %02X %02X %02X ", - (rtinfo->flags & IP6T_RT_RES), ((struct rt0_hdr *)rh)->bitmap, - !((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)->reserved))); ret = (rh != NULL) && @@ -179,12 +179,12 @@ match(const struct sk_buff *skb, !!(rtinfo->invflags & IP6T_RT_INV_TYP))); if (ret && (rtinfo->flags & IP6T_RT_RES)) { - u_int32_t *bp, _bitmap; - bp = skb_header_pointer(skb, - ptr + offsetof(struct rt0_hdr, bitmap), - sizeof(_bitmap), &_bitmap); + u_int32_t *rp, _reserved; + rp = skb_header_pointer(skb, + ptr + offsetof(struct rt0_hdr, reserved), + sizeof(_reserved), &_reserved); - ret = (*bp == 0); + ret = (*rp == 0); } DEBUGP("#%d ",rtinfo->addrnr); -- cgit v1.2.3-70-g09d2