Subject: ipv6only-flag-02 & Flags Expansion Option

From: David Farmer <[email-masked]>
Date: Wed, 19 Sep 2018 14:34:16 -0500

On Wed, Sep 19, 2018 at 2:02 PM, Ole Troan <[email-masked]> wrote:

> David,
>
> > This is not harmless. It costs us a bit from a limited pool,
>
> We have RFC5175 so this is hardly a scarce resource.
>

Do most IPv6 stacks actually implement the Flags Expansion Option in
section 4 of RFC5175?

Without the knowledge that most IPv6 stacks actually implement the Flags
Expansion Optio, I'd still characterize it as a limited resource.

Maybe we should use flag bit 9 for this purpose if we move it forward.

Thanks.

-- 
===============================================
David Farmer               Email:[email-masked]
Networking & Telecommunication Services
Office of Information Technology
University of Minnesota
2218 University Ave SE        Phone: 612-626-0815
Minneapolis, MN 55414-3029   Cell: 612-812-9952
===============================================

---

From: Brian E Carpenter <[email-masked]>
Date: Thu, 20 Sep 2018 10:55:27 +1200

> Maybe we should use flag bit 9 for this purpose if we move it forward.

I wouldn't immediately reject that, since we are talking about something
that requires an update to the host IPv6 stack anyway. Maybe we should
actually have a conversation about the best possible use of the two
reserved bits in the current flag byte.

     Brian

---

From: Alexandre Petrescu <[email-masked]>
Date: Thu, 20 Sep 2018 07:54:51 +0200

Le 19/09/2018 à 21:34, David Farmer a écrit :
> 
> On Wed, Sep 19, 2018 at 2:02 PM, Ole Troan <[email-masked] 
> <mailto:[email-masked]>> wrote:
> 
>     David,
> 

Linux kernel and radvd do not implement RFC5175 'Flags Expansion option'.

I wonder whether odhcp of openwrt implements RFC5175.

For information, attached to this email is a patch we wrote to the linux 
kernel 5 years ago to make rfc5175 to it.

> Maybe we should use flag bit 9 for this purpose if we move it forward.

I dont know, it is good to think about it.

Alex

> David Farmer Email:[email-masked] <mailto:[email-masked]>
> --------------------------------------------------------------------
> IETF IPv6 working group mailing list
> [email-masked]
> Administrative Requests: https://www.ietf.org/mailman/listinfo/ipv6
> --------------------------------------------------------------------
> 
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 23b3a7c..14b1696 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -34,6 +34,7 @@ enum {
 	__ND_OPT_ARRAY_MAX,
 	ND_OPT_ROUTE_INFO = 24,		/* RFC4191 */
 	ND_OPT_RDNSS = 25,		/* RFC5006 */
+	ND_OPT_RA_FLAGS_EXP = 26,	/* RFC5175 */
 	ND_OPT_DNSSL = 31,		/* RFC6106 */
 	__ND_OPT_MAX
 };
@@ -50,6 +51,7 @@ enum {
 #include <linux/if_arp.h>
 #include <linux/netdevice.h>
 #include <linux/hash.h>
+#include <asm/byteorder.h>
 
 #include <net/neighbour.h>
 
@@ -90,6 +92,28 @@ struct nd_opt_hdr {
 	__u8		nd_opt_len;
 } __packed;
 
+/* RFC5175 */
+struct ra_flags_exp {
+
+	__u8		type;
+	__u8		length;
+
+	union {
+		__u8		un_data8[6]; /* For private use */
+
+		struct { /* Subject to modification. Do not use reserved fields */
+#if defined(__BIG_ENDIAN_BITFIELD)
+			__u8		reserved[6];
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+			__u8		reserved[6];
+#endif
+		} __packed u_flags;
+
+	} __packed u_field;
+
+#define ra_flags_exp_data	u_field.un_data8;
+};
+
 /* ND options */
 struct ndisc_options {
 	struct nd_opt_hdr *nd_opt_array[__ND_OPT_ARRAY_MAX];
@@ -99,6 +123,7 @@ struct ndisc_options {
 #endif
 	struct nd_opt_hdr *nd_useropts;
 	struct nd_opt_hdr *nd_useropts_end;
+	struct nd_opt_hdr *nd_ra_flags_exp;
 };
 
 #define nd_opts_src_lladdr	nd_opt_array[ND_OPT_SOURCE_LL_ADDR]
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 6574175..b998e3a 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -239,6 +239,15 @@ struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
 				ndopts->nd_opts_ri = nd_opt;
 			break;
 #endif
+		case ND_OPT_RA_FLAGS_EXP:
+			if (ndopts->nd_ra_flags_exp) {
+				ND_PRINTK(2, warn,
+							"%s: duplicated RA flags expansion option found: type=%d\n",
+							__func__, nd_opt->nd_opt_type);
+			} else {
+				ndopts->nd_ra_flags_exp = nd_opt;
+			}
+			break;
 		default:
 			if (ndisc_is_useropt(nd_opt)) {
 				ndopts->nd_useropts_end = nd_opt;