[RFC] vxlan: netifd and vxlan package patches

Submitted by Johannes Kimmel on Aug. 1, 2020, 3:39 a.m.

Details

Message ID 20200801033902.30245-1-fff@bareminimum.eu
State Superseded
Headers show

Commit Message

Johannes Kimmel Aug. 1, 2020, 3:39 a.m.
netifd:
  - add srcportmin option
  - add srcportmax option (port exclusive)
  - add most missing boolean options

vxlan:
  - wire up the new vxlan options support
  - srcport
        option srcport "1337 31337" # for range, max is exclusive
        option srcport "1337" # for single srcport
    srcport string is split before sending over to netifd to make
    processing more robust on the netifd side.
  - learning
  - rsc
  - proxy
  - l2miss
  - l3miss
  - gbp

see ip-link(3)

Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
---
 .../openwrt/0015-netifd-vxlan-patches.patch   | 281 ++++++++++++++++++
 .../0016-vxlan-wire-up-more-options.patch     |  69 +++++
 2 files changed, 350 insertions(+)
 create mode 100644 build_patches/openwrt/0015-netifd-vxlan-patches.patch
 create mode 100644 build_patches/openwrt/0016-vxlan-wire-up-more-options.patch

Patch hide | download patch | download mbox

diff --git a/build_patches/openwrt/0015-netifd-vxlan-patches.patch b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
new file mode 100644
index 0000000..9861a40
--- /dev/null
+++ b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
@@ -0,0 +1,281 @@ 
+From a86c039c41e8dab1015766c677208181f5afbf4f Mon Sep 17 00:00:00 2001
+From: Johannes Kimmel <fff@bareminimum.eu>
+Date: Sat, 1 Aug 2020 04:23:41 +0200
+Subject: [PATCH 15/16] netifd: vxlan patches
+
+8fe4321 netifd: vxlan: add most missing boolean options
+9b258d8 netifd: vxlan: refactor mapping of boolean attrs
+84e8570 netifd: vxlan: handle srcport range
+
+Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
+---
+ ...01-netifd-vxlan-handle-srcport-range.patch | 98 +++++++++++++++++++
+ ...an-refactor-mapping-of-boolean-attrs.patch | 59 +++++++++++
+ ...lan-add-most-missing-boolean-options.patch | 84 ++++++++++++++++
+ 3 files changed, 241 insertions(+)
+ create mode 100644 package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-range.patch
+ create mode 100644 package/network/config/netifd/patches/0002-netifd-vxlan-refactor-mapping-of-boolean-attrs.patch
+ create mode 100644 package/network/config/netifd/patches/0003-netifd-vxlan-add-most-missing-boolean-options.patch
+
+diff --git a/package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-range.patch b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-range.patch
+new file mode 100644
+index 0000000000..46cf1ef893
+--- /dev/null
++++ b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-range.patch
+@@ -0,0 +1,98 @@
++From 84e857013a2880362d16aa7890cd62981c152ddb Mon Sep 17 00:00:00 2001
++From: Johannes Kimmel <fff@bareminimum.eu>
++Date: Sat, 1 Aug 2020 03:38:27 +0200
++Subject: [PATCH 1/3] netifd: vxlan: handle srcport range
++
++This adds adds the ability to set the source port range for vxlan
++interfaces.
++
++By default vxlans will use a random port within the ephermal range as
++source ports for packets. This is done to aid scaleability within a
++datacenter.
++
++But with these defaults it's impossible to punch through NATs or
++traverese most stateful firewalls easily. One solution is to fix the
++srcport to the same as dstport.
++
++If only srcportmin is specified, then srcportmax is set in a way that
++outgoing packets will only use srcportmin.
++
++If a range is to be specified, srcportmin and srcportmax have to be
++specified. srcportmax is exclusive.
++
++If only srcportmax is specified, the value is ignored and defaults are
++used.
++
++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
++---
++ system-linux.c | 26 ++++++++++++++++++++++++++
++ system.c       |  2 ++
++ system.h       |  2 ++
++ 3 files changed, 30 insertions(+)
++
++diff --git a/system-linux.c b/system-linux.c
++index c5583e0..5ff8749 100644
++--- a/system-linux.c
+++++ b/system-linux.c
++@@ -3184,6 +3184,32 @@ static int system_add_vxlan(const char *name, const unsigned int link, struct bl
++ 	}
++ 	nla_put_u16(msg, IFLA_VXLAN_PORT, htons(port));
++ 
+++	if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMIN])) {
+++		struct ifla_vxlan_port_range srcports = {0,0};
+++
+++		uint32_t low = blobmsg_get_u32(cur);
+++		if (low < 1 || low > 65535 - 1) {
+++			ret = -EINVAL;
+++			goto failure;
+++		}
+++
+++		srcports.low = htons((uint16_t) low);
+++		srcports.high = htons((uint16_t) (low+1));
+++
+++		if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMAX])) {
+++			uint32_t high = blobmsg_get_u32(cur);
+++			if (high < 1 || high > 65535) {
+++				ret = -EINVAL;
+++				goto failure;
+++			}
+++			if (high > low) {
+++				srcports.high = htons((uint16_t) high);
+++			}
+++		}
+++
+++		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports), &srcports);
+++	}
+++
++ 	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
++ 		bool rxcsum = blobmsg_get_bool(cur);
++ 		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, !rxcsum);
++diff --git a/system.c b/system.c
++index bbdfef7..4133e55 100644
++--- a/system.c
+++++ b/system.c
++@@ -38,6 +38,8 @@ static const struct blobmsg_policy vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
++ 	[VXLAN_DATA_ATTR_MACADDR] = { .name = "macaddr", .type = BLOBMSG_TYPE_STRING },
++ 	[VXLAN_DATA_ATTR_RXCSUM] = { .name = "rxcsum", .type = BLOBMSG_TYPE_BOOL },
++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type = BLOBMSG_TYPE_BOOL },
+++	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type = BLOBMSG_TYPE_INT32 },
+++	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type = BLOBMSG_TYPE_INT32 },
++ };
++ 
++ const struct uci_blob_param_list vxlan_data_attr_list = {
++diff --git a/system.h b/system.h
++index 015987f..bf9e1d7 100644
++--- a/system.h
+++++ b/system.h
++@@ -44,6 +44,8 @@ enum vxlan_data {
++ 	VXLAN_DATA_ATTR_MACADDR,
++ 	VXLAN_DATA_ATTR_RXCSUM,
++ 	VXLAN_DATA_ATTR_TXCSUM,
+++	VXLAN_DATA_ATTR_SRCPORTMIN,
+++	VXLAN_DATA_ATTR_SRCPORTMAX,
++ 	__VXLAN_DATA_ATTR_MAX
++ };
++ 
++-- 
++2.28.0
++
+diff --git a/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-mapping-of-boolean-attrs.patch b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-mapping-of-boolean-attrs.patch
+new file mode 100644
+index 0000000000..a868ad64f8
+--- /dev/null
++++ b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-mapping-of-boolean-attrs.patch
+@@ -0,0 +1,59 @@
++From 9b258d8c7f5140fa3e19d3e5c19b9cef84ff80f7 Mon Sep 17 00:00:00 2001
++From: Johannes Kimmel <fff@bareminimum.eu>
++Date: Sat, 1 Aug 2020 03:59:55 +0200
++Subject: [PATCH 2/3] netifd: vxlan: refactor mapping of boolean attrs
++
++Add a small function to handle boolean options and make use of it to handle:
++  - rxcsum
++  - txcsum
++
++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
++---
++ system-linux.c | 24 ++++++++++++++----------
++ 1 file changed, 14 insertions(+), 10 deletions(-)
++
++diff --git a/system-linux.c b/system-linux.c
++index 5ff8749..82b65e3 100644
++--- a/system-linux.c
+++++ b/system-linux.c
++@@ -3073,6 +3073,17 @@ failure:
++ #endif
++ 
++ #ifdef IFLA_VXLAN_MAX
+++static void system_vxlan_map_bool_attr(struct nl_msg *msg, struct blob_attr **tb_data, int attrtype, int vxlandatatype, bool invert) {
+++	struct blob_attr *cur;
+++	if ((cur = tb_data[vxlandatatype])) {
+++		bool val = blobmsg_get_bool(cur);
+++		if (invert) {
+++			val = !val;
+++		}
+++		nla_put_u8(msg, attrtype, val);
+++	}
+++}
+++
++ static int system_add_vxlan(const char *name, const unsigned int link, struct blob_attr **tb, bool v6)
++ {
++ 	struct blob_attr *tb_data[__VXLAN_DATA_ATTR_MAX];
++@@ -3210,16 +3221,9 @@ static int system_add_vxlan(const char *name, const unsigned int link, struct bl
++ 		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports), &srcports);
++ 	}
++ 
++-	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
++-		bool rxcsum = blobmsg_get_bool(cur);
++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, !rxcsum);
++-	}
++-
++-	if ((cur = tb_data[VXLAN_DATA_ATTR_TXCSUM])) {
++-		bool txcsum = blobmsg_get_bool(cur);
++-		nla_put_u8(msg, IFLA_VXLAN_UDP_CSUM, txcsum);
++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, !txcsum);
++-	}
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM, true);
++ 
++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
++ 		char *str = blobmsg_get_string(cur);
++-- 
++2.28.0
++
+diff --git a/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-missing-boolean-options.patch b/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-missing-boolean-options.patch
+new file mode 100644
+index 0000000000..228c0cd37f
+--- /dev/null
++++ b/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-missing-boolean-options.patch
+@@ -0,0 +1,84 @@
++From 8fe4321a8d7ec7b28b7011f67c88a07584160a47 Mon Sep 17 00:00:00 2001
++From: Johannes Kimmel <fff@bareminimum.eu>
++Date: Sat, 1 Aug 2020 04:05:31 +0200
++Subject: [PATCH 3/3] netifd: vxlan: add most missing boolean options
++
++adds the folloing missing options:
++  - learning
++  - rsc
++  - proxy
++  - l2miss
++  - l3miss
++  - gbp
++
++See ip-link(3) for their meaning.
++
++still missing:
++  - external
++  - gpe
++
++I'm not sure how to handle them at the moment. It's unclear to me what
++IFLA_VXLAN_* value corresponds to the 'external' option and according to
++the manpage, gpe depends on it.
++
++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
++---
++ system-linux.c | 6 ++++++
++ system.c       | 6 ++++++
++ system.h       | 6 ++++++
++ 3 files changed, 18 insertions(+)
++
++diff --git a/system-linux.c b/system-linux.c
++index 82b65e3..d129fef 100644
++--- a/system-linux.c
+++++ b/system-linux.c
++@@ -3224,6 +3224,12 @@ static int system_add_vxlan(const char *name, const unsigned int link, struct bl
++ 	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
++ 	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
++ 	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM, true);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_LEARNING, VXLAN_DATA_ATTR_LEARNING, false);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_RSC , VXLAN_DATA_ATTR_RSC, false);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_PROXY , VXLAN_DATA_ATTR_PROXY, false);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L2MISS , VXLAN_DATA_ATTR_L2MISS, false);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L3MISS , VXLAN_DATA_ATTR_L3MISS, false);
+++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_GBP , VXLAN_DATA_ATTR_GBP, false);
++ 
++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
++ 		char *str = blobmsg_get_string(cur);
++diff --git a/system.c b/system.c
++index 4133e55..95721e1 100644
++--- a/system.c
+++++ b/system.c
++@@ -40,6 +40,12 @@ static const struct blobmsg_policy vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type = BLOBMSG_TYPE_BOOL },
++ 	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type = BLOBMSG_TYPE_INT32 },
++ 	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type = BLOBMSG_TYPE_INT32 },
+++	[VXLAN_DATA_ATTR_LEARNING] = { .name = "learning", .type = BLOBMSG_TYPE_BOOL },
+++	[VXLAN_DATA_ATTR_RSC] = { .name = "rsc", .type = BLOBMSG_TYPE_BOOL },
+++	[VXLAN_DATA_ATTR_PROXY] = { .name = "proxy", .type = BLOBMSG_TYPE_BOOL },
+++	[VXLAN_DATA_ATTR_L2MISS] = { .name = "l2miss", .type = BLOBMSG_TYPE_BOOL },
+++	[VXLAN_DATA_ATTR_L3MISS] = { .name = "l3miss", .type = BLOBMSG_TYPE_BOOL },
+++	[VXLAN_DATA_ATTR_GBP] = { .name = "gbp", .type = BLOBMSG_TYPE_BOOL },
++ };
++ 
++ const struct uci_blob_param_list vxlan_data_attr_list = {
++diff --git a/system.h b/system.h
++index bf9e1d7..290c2e5 100644
++--- a/system.h
+++++ b/system.h
++@@ -46,6 +46,12 @@ enum vxlan_data {
++ 	VXLAN_DATA_ATTR_TXCSUM,
++ 	VXLAN_DATA_ATTR_SRCPORTMIN,
++ 	VXLAN_DATA_ATTR_SRCPORTMAX,
+++	VXLAN_DATA_ATTR_LEARNING,
+++	VXLAN_DATA_ATTR_RSC,
+++	VXLAN_DATA_ATTR_PROXY,
+++	VXLAN_DATA_ATTR_L2MISS,
+++	VXLAN_DATA_ATTR_L3MISS,
+++	VXLAN_DATA_ATTR_GBP,
++ 	__VXLAN_DATA_ATTR_MAX
++ };
++ 
++-- 
++2.28.0
++
+-- 
+2.28.0
+
diff --git a/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
new file mode 100644
index 0000000..97d3422
--- /dev/null
+++ b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
@@ -0,0 +1,69 @@ 
+From a013910a253fdbaf3eccd546eb93dc10e2291689 Mon Sep 17 00:00:00 2001
+From: Johannes Kimmel <fff@bareminimum.eu>
+Date: Sat, 1 Aug 2020 04:33:11 +0200
+Subject: [PATCH 16/16] vxlan: wire-up more options
+
+Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
+---
+ package/network/config/vxlan/files/vxlan.sh | 22 +++++++++++++++++++--
+ 1 file changed, 20 insertions(+), 2 deletions(-)
+
+diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh
+index d063c47d47..b1d106c47d 100755
+--- a/package/network/config/vxlan/files/vxlan.sh
++++ b/package/network/config/vxlan/files/vxlan.sh
+@@ -59,8 +59,11 @@ vxlan_generic_setup() {
+ 
+ 	local link="$cfg"
+ 
+-	local port vid ttl tos mtu macaddr zone rxcsum txcsum
+-	json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum
++	local port srcport srcportmin srcportmax vid ttl tos mtu macaddr zone rxcsum txcsum learning rsc proxy l2miss l3miss gbp
++	json_get_vars port srcport vid ttl tos mtu macaddr zone rxcsum txcsum learning rsc proxy l2miss l3miss gbp
++
++	srcportmin=$(echo $srcport | cut -d' ' -f1)
++	srcportmax=$(echo $srcport | cut -d' ' -f2)
+ 
+ 	proto_init_update "$link" 1
+ 
+@@ -77,10 +80,18 @@ vxlan_generic_setup() {
+ 
+ 	json_add_object 'data'
+ 	[ -n "$port" ] && json_add_int port "$port"
++	[ -n "$srcportmin" ] && json_add_int srcportmin "$srcportmin"
++	[ -n "$srcportmax" ] && json_add_int srcportmax "$srcportmax"
+ 	[ -n "$vid" ] && json_add_int id "$vid"
+ 	[ -n "$macaddr" ] && json_add_string macaddr "$macaddr"
+ 	[ -n "$rxcsum" ] && json_add_boolean rxcsum "$rxcsum"
+ 	[ -n "$txcsum" ] && json_add_boolean txcsum "$txcsum"
++	[ -n "$learning" ] && json_add_boolean learning "$learning"
++	[ -n "$rsc" ] && json_add_boolean rsc "$rsc"
++	[ -n "$proxy" ] && json_add_boolean proxy "$proxy"
++	[ -n "$l2miss" ] && json_add_boolean l2miss "$l2miss"
++	[ -n "$l3miss" ] && json_add_boolean l3miss "$l3miss"
++	[ -n "$gbp" ] && json_add_boolean gbp "$gbp"
+ 	json_close_object
+ 
+ 	proto_close_tunnel
+@@ -160,11 +171,18 @@ vxlan_generic_init_config() {
+ 
+ 	proto_config_add_int "vid"
+ 	proto_config_add_int "port"
++	proto_config_add_string "srcport"
+ 	proto_config_add_int "ttl"
+ 	proto_config_add_int "tos"
+ 	proto_config_add_int "mtu"
+ 	proto_config_add_boolean "rxcsum"
+ 	proto_config_add_boolean "txcsum"
++	proto_config_add_boolean "learning"
++	proto_config_add_boolean "rsc"
++	proto_config_add_boolean "proxy"
++	proto_config_add_boolean "l2miss"
++	proto_config_add_boolean "l3miss"
++	proto_config_add_boolean "gbp"
+ 	proto_config_add_string "macaddr"
+ }
+ 
+-- 
+2.28.0
+

Comments

Adrian Schmutzler Aug. 1, 2020, 10:16 a.m.
Hallo lemmi,

ich habe gesehen, dass da RFC dran steht; wenn/falls es eine Diskussion hier gegeben hat, sollte dies aber meiner Meinung nach erstmal durch Upstream durch (zumindest so, dass es mal in netifd drin ist).

Zur Diskussion selbst kann ich leider nicht viel beitragen.

Beste Grüße

Adrian

> -----Original Message-----
> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf
> Of Johannes Kimmel
> Sent: Samstag, 1. August 2020 05:39
> To: franken-dev@freifunk.net
> Subject: [RFC PATCH] vxlan: netifd and vxlan package patches
> 
> netifd:
>   - add srcportmin option
>   - add srcportmax option (port exclusive)
>   - add most missing boolean options
> 
> vxlan:
>   - wire up the new vxlan options support
>   - srcport
>         option srcport "1337 31337" # for range, max is exclusive
>         option srcport "1337" # for single srcport
>     srcport string is split before sending over to netifd to make
>     processing more robust on the netifd side.
>   - learning
>   - rsc
>   - proxy
>   - l2miss
>   - l3miss
>   - gbp
> 
> see ip-link(3)
> 
> Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
> ---
>  .../openwrt/0015-netifd-vxlan-patches.patch   | 281 ++++++++++++++++++
>  .../0016-vxlan-wire-up-more-options.patch     |  69 +++++
>  2 files changed, 350 insertions(+)
>  create mode 100644 build_patches/openwrt/0015-netifd-vxlan-
> patches.patch
>  create mode 100644 build_patches/openwrt/0016-vxlan-wire-up-more-
> options.patch
> 
> diff --git a/build_patches/openwrt/0015-netifd-vxlan-patches.patch
> b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
> new file mode 100644
> index 0000000..9861a40
> --- /dev/null
> +++ b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
> @@ -0,0 +1,281 @@
> +From a86c039c41e8dab1015766c677208181f5afbf4f Mon Sep 17 00:00:00
> 2001
> +From: Johannes Kimmel <fff@bareminimum.eu>
> +Date: Sat, 1 Aug 2020 04:23:41 +0200
> +Subject: [PATCH 15/16] netifd: vxlan patches
> +
> +8fe4321 netifd: vxlan: add most missing boolean options
> +9b258d8 netifd: vxlan: refactor mapping of boolean attrs
> +84e8570 netifd: vxlan: handle srcport range
> +
> +Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
> +---
> + ...01-netifd-vxlan-handle-srcport-range.patch | 98
> +++++++++++++++++++
> +...an-refactor-mapping-of-boolean-attrs.patch | 59 +++++++++++
> +...lan-add-most-missing-boolean-options.patch | 84 ++++++++++++++++
> + 3 files changed, 241 insertions(+)
> + create mode 100644
> +package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-
> +range.patch  create mode 100644
> +package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
> mappin
> +g-of-boolean-attrs.patch  create mode 100644
> +package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
> missin
> +g-boolean-options.patch
> +
> +diff --git
> +a/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
> srcpor
> +t-range.patch
> +b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
> srcpor
> +t-range.patch
> +new file mode 100644
> +index 0000000000..46cf1ef893
> +--- /dev/null
> ++++ b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
> sr
> ++++ cport-range.patch
> +@@ -0,0 +1,98 @@
> ++From 84e857013a2880362d16aa7890cd62981c152ddb Mon Sep 17 00:00:00
> 2001
> ++From: Johannes Kimmel <fff@bareminimum.eu>
> ++Date: Sat, 1 Aug 2020 03:38:27 +0200
> ++Subject: [PATCH 1/3] netifd: vxlan: handle srcport range
> ++
> ++This adds adds the ability to set the source port range for vxlan
> ++interfaces.
> ++
> ++By default vxlans will use a random port within the ephermal range as
> ++source ports for packets. This is done to aid scaleability within a
> ++datacenter.
> ++
> ++But with these defaults it's impossible to punch through NATs or
> ++traverese most stateful firewalls easily. One solution is to fix the
> ++srcport to the same as dstport.
> ++
> ++If only srcportmin is specified, then srcportmax is set in a way that
> ++outgoing packets will only use srcportmin.
> ++
> ++If a range is to be specified, srcportmin and srcportmax have to be
> ++specified. srcportmax is exclusive.
> ++
> ++If only srcportmax is specified, the value is ignored and defaults are
> ++used.
> ++
> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
> ++---
> ++ system-linux.c | 26 ++++++++++++++++++++++++++
> ++ system.c       |  2 ++
> ++ system.h       |  2 ++
> ++ 3 files changed, 30 insertions(+)
> ++
> ++diff --git a/system-linux.c b/system-linux.c index c5583e0..5ff8749
> ++100644
> ++--- a/system-linux.c
> +++++ b/system-linux.c
> ++@@ -3184,6 +3184,32 @@ static int system_add_vxlan(const char *name,
> const unsigned int link, struct bl
> ++ 	}
> ++ 	nla_put_u16(msg, IFLA_VXLAN_PORT, htons(port));
> ++
> +++	if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMIN])) {
> +++		struct ifla_vxlan_port_range srcports = {0,0};
> +++
> +++		uint32_t low = blobmsg_get_u32(cur);
> +++		if (low < 1 || low > 65535 - 1) {
> +++			ret = -EINVAL;
> +++			goto failure;
> +++		}
> +++
> +++		srcports.low = htons((uint16_t) low);
> +++		srcports.high = htons((uint16_t) (low+1));
> +++
> +++		if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMAX])) {
> +++			uint32_t high = blobmsg_get_u32(cur);
> +++			if (high < 1 || high > 65535) {
> +++				ret = -EINVAL;
> +++				goto failure;
> +++			}
> +++			if (high > low) {
> +++				srcports.high = htons((uint16_t) high);
> +++			}
> +++		}
> +++
> +++		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports),
> &srcports);
> +++	}
> +++
> ++ 	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
> ++ 		bool rxcsum = blobmsg_get_bool(cur);
> ++ 		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
> !rxcsum); diff --git
> ++a/system.c b/system.c index bbdfef7..4133e55 100644
> ++--- a/system.c
> +++++ b/system.c
> ++@@ -38,6 +38,8 @@ static const struct blobmsg_policy
> vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
> ++ 	[VXLAN_DATA_ATTR_MACADDR] = { .name = "macaddr", .type =
> BLOBMSG_TYPE_STRING },
> ++ 	[VXLAN_DATA_ATTR_RXCSUM] = { .name = "rxcsum", .type =
> BLOBMSG_TYPE_BOOL },
> ++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
> ++BLOBMSG_TYPE_BOOL },
> +++	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type
> = BLOBMSG_TYPE_INT32 },
> +++	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type
> =
> +++BLOBMSG_TYPE_INT32 },
> ++ };
> ++
> ++ const struct uci_blob_param_list vxlan_data_attr_list = { diff --git
> ++a/system.h b/system.h index 015987f..bf9e1d7 100644
> ++--- a/system.h
> +++++ b/system.h
> ++@@ -44,6 +44,8 @@ enum vxlan_data {
> ++ 	VXLAN_DATA_ATTR_MACADDR,
> ++ 	VXLAN_DATA_ATTR_RXCSUM,
> ++ 	VXLAN_DATA_ATTR_TXCSUM,
> +++	VXLAN_DATA_ATTR_SRCPORTMIN,
> +++	VXLAN_DATA_ATTR_SRCPORTMAX,
> ++ 	__VXLAN_DATA_ATTR_MAX
> ++ };
> ++
> ++--
> ++2.28.0
> ++
> +diff --git
> +a/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
> mapp
> +ing-of-boolean-attrs.patch
> +b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
> mapp
> +ing-of-boolean-attrs.patch
> +new file mode 100644
> +index 0000000000..a868ad64f8
> +--- /dev/null
> ++++ b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
> ++++ mapping-of-boolean-attrs.patch
> +@@ -0,0 +1,59 @@
> ++From 9b258d8c7f5140fa3e19d3e5c19b9cef84ff80f7 Mon Sep 17 00:00:00
> 2001
> ++From: Johannes Kimmel <fff@bareminimum.eu>
> ++Date: Sat, 1 Aug 2020 03:59:55 +0200
> ++Subject: [PATCH 2/3] netifd: vxlan: refactor mapping of boolean attrs
> ++
> ++Add a small function to handle boolean options and make use of it to
> handle:
> ++  - rxcsum
> ++  - txcsum
> ++
> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
> ++---
> ++ system-linux.c | 24 ++++++++++++++----------
> ++ 1 file changed, 14 insertions(+), 10 deletions(-)
> ++
> ++diff --git a/system-linux.c b/system-linux.c index 5ff8749..82b65e3
> ++100644
> ++--- a/system-linux.c
> +++++ b/system-linux.c
> ++@@ -3073,6 +3073,17 @@ failure:
> ++ #endif
> ++
> ++ #ifdef IFLA_VXLAN_MAX
> +++static void system_vxlan_map_bool_attr(struct nl_msg *msg, struct
> blob_attr **tb_data, int attrtype, int vxlandatatype, bool invert) {
> +++	struct blob_attr *cur;
> +++	if ((cur = tb_data[vxlandatatype])) {
> +++		bool val = blobmsg_get_bool(cur);
> +++		if (invert) {
> +++			val = !val;
> +++		}
> +++		nla_put_u8(msg, attrtype, val);
> +++	}
> +++}
> +++
> ++ static int system_add_vxlan(const char *name, const unsigned int
> ++link, struct blob_attr **tb, bool v6)  {
> ++ 	struct blob_attr *tb_data[__VXLAN_DATA_ATTR_MAX]; @@ -
> 3210,16
> +++3221,9 @@ static int system_add_vxlan(const char *name, const
> unsigned int link, struct bl
> ++ 		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports),
> &srcports);
> ++ 	}
> ++
> ++-	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
> ++-		bool rxcsum = blobmsg_get_bool(cur);
> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
> !rxcsum);
> ++-	}
> ++-
> ++-	if ((cur = tb_data[VXLAN_DATA_ATTR_TXCSUM])) {
> ++-		bool txcsum = blobmsg_get_bool(cur);
> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_CSUM, txcsum);
> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
> !txcsum);
> ++-	}
> +++	system_vxlan_map_bool_attr(msg, tb_data,
> IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
> +++	system_vxlan_map_bool_attr(msg, tb_data,
> IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
> +++	system_vxlan_map_bool_attr(msg, tb_data,
> +++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
> true);
> ++
> ++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
> ++ 		char *str = blobmsg_get_string(cur);
> ++--
> ++2.28.0
> ++
> +diff --git
> +a/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
> miss
> +ing-boolean-options.patch
> +b/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
> miss
> +ing-boolean-options.patch
> +new file mode 100644
> +index 0000000000..228c0cd37f
> +--- /dev/null
> ++++ b/package/network/config/netifd/patches/0003-netifd-vxlan-add-
> most-
> ++++ missing-boolean-options.patch
> +@@ -0,0 +1,84 @@
> ++From 8fe4321a8d7ec7b28b7011f67c88a07584160a47 Mon Sep 17 00:00:00
> 2001
> ++From: Johannes Kimmel <fff@bareminimum.eu>
> ++Date: Sat, 1 Aug 2020 04:05:31 +0200
> ++Subject: [PATCH 3/3] netifd: vxlan: add most missing boolean options
> ++
> ++adds the folloing missing options:
> ++  - learning
> ++  - rsc
> ++  - proxy
> ++  - l2miss
> ++  - l3miss
> ++  - gbp
> ++
> ++See ip-link(3) for their meaning.
> ++
> ++still missing:
> ++  - external
> ++  - gpe
> ++
> ++I'm not sure how to handle them at the moment. It's unclear to me what
> ++IFLA_VXLAN_* value corresponds to the 'external' option and according
> ++to the manpage, gpe depends on it.
> ++
> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
> ++---
> ++ system-linux.c | 6 ++++++
> ++ system.c       | 6 ++++++
> ++ system.h       | 6 ++++++
> ++ 3 files changed, 18 insertions(+)
> ++
> ++diff --git a/system-linux.c b/system-linux.c index 82b65e3..d129fef
> ++100644
> ++--- a/system-linux.c
> +++++ b/system-linux.c
> ++@@ -3224,6 +3224,12 @@ static int system_add_vxlan(const char *name,
> const unsigned int link, struct bl
> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
> IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
> IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
> ++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
> true);
> +++	system_vxlan_map_bool_attr(msg, tb_data,
> IFLA_VXLAN_LEARNING, VXLAN_DATA_ATTR_LEARNING, false);
> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_RSC ,
> VXLAN_DATA_ATTR_RSC, false);
> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_PROXY ,
> VXLAN_DATA_ATTR_PROXY, false);
> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L2MISS ,
> VXLAN_DATA_ATTR_L2MISS, false);
> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L3MISS ,
> VXLAN_DATA_ATTR_L3MISS, false);
> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_GBP ,
> +++VXLAN_DATA_ATTR_GBP, false);
> ++
> ++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
> ++ 		char *str = blobmsg_get_string(cur); diff --git a/system.c
> ++b/system.c index 4133e55..95721e1 100644
> ++--- a/system.c
> +++++ b/system.c
> ++@@ -40,6 +40,12 @@ static const struct blobmsg_policy
> vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
> ++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
> BLOBMSG_TYPE_BOOL },
> ++ 	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type
> = BLOBMSG_TYPE_INT32 },
> ++ 	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type
> =
> ++BLOBMSG_TYPE_INT32 },
> +++	[VXLAN_DATA_ATTR_LEARNING] = { .name = "learning", .type =
> BLOBMSG_TYPE_BOOL },
> +++	[VXLAN_DATA_ATTR_RSC] = { .name = "rsc", .type =
> BLOBMSG_TYPE_BOOL },
> +++	[VXLAN_DATA_ATTR_PROXY] = { .name = "proxy", .type =
> BLOBMSG_TYPE_BOOL },
> +++	[VXLAN_DATA_ATTR_L2MISS] = { .name = "l2miss", .type =
> BLOBMSG_TYPE_BOOL },
> +++	[VXLAN_DATA_ATTR_L3MISS] = { .name = "l3miss", .type =
> BLOBMSG_TYPE_BOOL },
> +++	[VXLAN_DATA_ATTR_GBP] = { .name = "gbp", .type =
> BLOBMSG_TYPE_BOOL
> +++},
> ++ };
> ++
> ++ const struct uci_blob_param_list vxlan_data_attr_list = { diff --git
> ++a/system.h b/system.h index bf9e1d7..290c2e5 100644
> ++--- a/system.h
> +++++ b/system.h
> ++@@ -46,6 +46,12 @@ enum vxlan_data {
> ++ 	VXLAN_DATA_ATTR_TXCSUM,
> ++ 	VXLAN_DATA_ATTR_SRCPORTMIN,
> ++ 	VXLAN_DATA_ATTR_SRCPORTMAX,
> +++	VXLAN_DATA_ATTR_LEARNING,
> +++	VXLAN_DATA_ATTR_RSC,
> +++	VXLAN_DATA_ATTR_PROXY,
> +++	VXLAN_DATA_ATTR_L2MISS,
> +++	VXLAN_DATA_ATTR_L3MISS,
> +++	VXLAN_DATA_ATTR_GBP,
> ++ 	__VXLAN_DATA_ATTR_MAX
> ++ };
> ++
> ++--
> ++2.28.0
> ++
> +--
> +2.28.0
> +
> diff --git a/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
> b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
> new file mode 100644
> index 0000000..97d3422
> --- /dev/null
> +++ b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
> @@ -0,0 +1,69 @@
> +From a013910a253fdbaf3eccd546eb93dc10e2291689 Mon Sep 17 00:00:00
> 2001
> +From: Johannes Kimmel <fff@bareminimum.eu>
> +Date: Sat, 1 Aug 2020 04:33:11 +0200
> +Subject: [PATCH 16/16] vxlan: wire-up more options
> +
> +Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
> +---
> + package/network/config/vxlan/files/vxlan.sh | 22
> +++++++++++++++++++--
> + 1 file changed, 20 insertions(+), 2 deletions(-)
> +
> +diff --git a/package/network/config/vxlan/files/vxlan.sh
> +b/package/network/config/vxlan/files/vxlan.sh
> +index d063c47d47..b1d106c47d 100755
> +--- a/package/network/config/vxlan/files/vxlan.sh
> ++++ b/package/network/config/vxlan/files/vxlan.sh
> +@@ -59,8 +59,11 @@ vxlan_generic_setup() {
> +
> + 	local link="$cfg"
> +
> +-	local port vid ttl tos mtu macaddr zone rxcsum txcsum
> +-	json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum
> ++	local port srcport srcportmin srcportmax vid ttl tos mtu macaddr zone
> rxcsum txcsum learning rsc proxy l2miss l3miss gbp
> ++	json_get_vars port srcport vid ttl tos mtu macaddr zone rxcsum
> txcsum
> ++learning rsc proxy l2miss l3miss gbp
> ++
> ++	srcportmin=$(echo $srcport | cut -d' ' -f1)
> ++	srcportmax=$(echo $srcport | cut -d' ' -f2)
> +
> + 	proto_init_update "$link" 1
> +
> +@@ -77,10 +80,18 @@ vxlan_generic_setup() {
> +
> + 	json_add_object 'data'
> + 	[ -n "$port" ] && json_add_int port "$port"
> ++	[ -n "$srcportmin" ] && json_add_int srcportmin "$srcportmin"
> ++	[ -n "$srcportmax" ] && json_add_int srcportmax "$srcportmax"
> + 	[ -n "$vid" ] && json_add_int id "$vid"
> + 	[ -n "$macaddr" ] && json_add_string macaddr "$macaddr"
> + 	[ -n "$rxcsum" ] && json_add_boolean rxcsum "$rxcsum"
> + 	[ -n "$txcsum" ] && json_add_boolean txcsum "$txcsum"
> ++	[ -n "$learning" ] && json_add_boolean learning "$learning"
> ++	[ -n "$rsc" ] && json_add_boolean rsc "$rsc"
> ++	[ -n "$proxy" ] && json_add_boolean proxy "$proxy"
> ++	[ -n "$l2miss" ] && json_add_boolean l2miss "$l2miss"
> ++	[ -n "$l3miss" ] && json_add_boolean l3miss "$l3miss"
> ++	[ -n "$gbp" ] && json_add_boolean gbp "$gbp"
> + 	json_close_object
> +
> + 	proto_close_tunnel
> +@@ -160,11 +171,18 @@ vxlan_generic_init_config() {
> +
> + 	proto_config_add_int "vid"
> + 	proto_config_add_int "port"
> ++	proto_config_add_string "srcport"
> + 	proto_config_add_int "ttl"
> + 	proto_config_add_int "tos"
> + 	proto_config_add_int "mtu"
> + 	proto_config_add_boolean "rxcsum"
> + 	proto_config_add_boolean "txcsum"
> ++	proto_config_add_boolean "learning"
> ++	proto_config_add_boolean "rsc"
> ++	proto_config_add_boolean "proxy"
> ++	proto_config_add_boolean "l2miss"
> ++	proto_config_add_boolean "l3miss"
> ++	proto_config_add_boolean "gbp"
> + 	proto_config_add_string "macaddr"
> + }
> +
> +--
> +2.28.0
> +
> --
> 2.28.0
Johannes Kimmel Aug. 1, 2020, 11:31 a.m.
Hi,

also bei dem ganzen Umbau fehlt noch etwas, aber es ist genug, dass wir 
die ersten tests mit vxlan fuer fuer die Node Firmware fahren koennen. 
Bevor ich Upstream zuballer mit dem Zeug haette ich das alles gerne 
einmal im kleineren Rahmen ausprobiert und eventuell erkennt jetzt schon 
jemand Fehler, die schon gar nicht nach Upstream muessen.

Ist halt etwas schlecht von der Übersichtlichkeit, weil die patches fuer 
den netifd quasi 3 Tief sind.

Also patches fuer netifd sind im netifd repo entstanden, dann als 
Patchdateien im openwrt repo in den netifd/patches Ordner gelegt und 
diese Aenderung ist der Patch hier :)

Falls es jemand moechte, kann ich die netifd patches auch mal nackig 
hier her legen, oder vielleicht fork ich das repo mal in unserem gitea 
und leg dort nen branch an.

Auf der TODO liste sind noch:

   - Den automatismus entfernen, der die local ip adresse automatisch aus
     dem tunlink ableitet. Eventuell nur dann, wenn
         option ip6addr 'auto'
         option tunlink 'wan6'
     gesetzt ist. Das brauchen wir, damit sich bei aenderten prefixes bei
     clients automatisch eine passende src adresse benutzt wird.
   - netifd/libnl3 genauer untersuchen inwiefern auf endianess aufgepasst
     werden muss. Momentan ist das nen durcheinander und vermutlich nur
     deswegen nicht aufgefallen, weil OpenWRT hauptsaechlich mit
     bigendian hardware betrieben wird.
   - Die GBP option funktioniert nicht (interface kommt nicht hoch, wenn
     sie verwendet wird)
   - Die letzten Paar anderen Optionen noch reinbauen, vorallem ageing.

Bei den Sachen koennte ich noch etwas input gebrauchen. Im ersten Punkt 
Designtechnisch und vielleicht weiß bei Punkt 2 jemand die passende 
antwort oder kann auf littleendian probieren.

Naja, genug geschwafelt. Bin mal gespannt, ob vxlan der Node Firmware 
helfen kann, also brav spielen und testen :)

Gruesse,

Johannes


On 01.08.20 12:16, mail@adrianschmutzler.de wrote:
> Hallo lemmi,
> 
> ich habe gesehen, dass da RFC dran steht; wenn/falls es eine Diskussion hier gegeben hat, sollte dies aber meiner Meinung nach erstmal durch Upstream durch (zumindest so, dass es mal in netifd drin ist).
> 
> Zur Diskussion selbst kann ich leider nicht viel beitragen.
> 
> Beste Grüße
> 
> Adrian
> 
>> -----Original Message-----
>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf
>> Of Johannes Kimmel
>> Sent: Samstag, 1. August 2020 05:39
>> To: franken-dev@freifunk.net
>> Subject: [RFC PATCH] vxlan: netifd and vxlan package patches
>>
>> netifd:
>>    - add srcportmin option
>>    - add srcportmax option (port exclusive)
>>    - add most missing boolean options
>>
>> vxlan:
>>    - wire up the new vxlan options support
>>    - srcport
>>          option srcport "1337 31337" # for range, max is exclusive
>>          option srcport "1337" # for single srcport
>>      srcport string is split before sending over to netifd to make
>>      processing more robust on the netifd side.
>>    - learning
>>    - rsc
>>    - proxy
>>    - l2miss
>>    - l3miss
>>    - gbp
>>
>> see ip-link(3)
>>
>> Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>> ---
>>   .../openwrt/0015-netifd-vxlan-patches.patch   | 281 ++++++++++++++++++
>>   .../0016-vxlan-wire-up-more-options.patch     |  69 +++++
>>   2 files changed, 350 insertions(+)
>>   create mode 100644 build_patches/openwrt/0015-netifd-vxlan-
>> patches.patch
>>   create mode 100644 build_patches/openwrt/0016-vxlan-wire-up-more-
>> options.patch
>>
>> diff --git a/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>> b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>> new file mode 100644
>> index 0000000..9861a40
>> --- /dev/null
>> +++ b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>> @@ -0,0 +1,281 @@
>> +From a86c039c41e8dab1015766c677208181f5afbf4f Mon Sep 17 00:00:00
>> 2001
>> +From: Johannes Kimmel <fff@bareminimum.eu>
>> +Date: Sat, 1 Aug 2020 04:23:41 +0200
>> +Subject: [PATCH 15/16] netifd: vxlan patches
>> +
>> +8fe4321 netifd: vxlan: add most missing boolean options
>> +9b258d8 netifd: vxlan: refactor mapping of boolean attrs
>> +84e8570 netifd: vxlan: handle srcport range
>> +
>> +Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>> +---
>> + ...01-netifd-vxlan-handle-srcport-range.patch | 98
>> +++++++++++++++++++
>> +...an-refactor-mapping-of-boolean-attrs.patch | 59 +++++++++++
>> +...lan-add-most-missing-boolean-options.patch | 84 ++++++++++++++++
>> + 3 files changed, 241 insertions(+)
>> + create mode 100644
>> +package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-
>> +range.patch  create mode 100644
>> +package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>> mappin
>> +g-of-boolean-attrs.patch  create mode 100644
>> +package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>> missin
>> +g-boolean-options.patch
>> +
>> +diff --git
>> +a/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>> srcpor
>> +t-range.patch
>> +b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>> srcpor
>> +t-range.patch
>> +new file mode 100644
>> +index 0000000000..46cf1ef893
>> +--- /dev/null
>> ++++ b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>> sr
>> ++++ cport-range.patch
>> +@@ -0,0 +1,98 @@
>> ++From 84e857013a2880362d16aa7890cd62981c152ddb Mon Sep 17 00:00:00
>> 2001
>> ++From: Johannes Kimmel <fff@bareminimum.eu>
>> ++Date: Sat, 1 Aug 2020 03:38:27 +0200
>> ++Subject: [PATCH 1/3] netifd: vxlan: handle srcport range
>> ++
>> ++This adds adds the ability to set the source port range for vxlan
>> ++interfaces.
>> ++
>> ++By default vxlans will use a random port within the ephermal range as
>> ++source ports for packets. This is done to aid scaleability within a
>> ++datacenter.
>> ++
>> ++But with these defaults it's impossible to punch through NATs or
>> ++traverese most stateful firewalls easily. One solution is to fix the
>> ++srcport to the same as dstport.
>> ++
>> ++If only srcportmin is specified, then srcportmax is set in a way that
>> ++outgoing packets will only use srcportmin.
>> ++
>> ++If a range is to be specified, srcportmin and srcportmax have to be
>> ++specified. srcportmax is exclusive.
>> ++
>> ++If only srcportmax is specified, the value is ignored and defaults are
>> ++used.
>> ++
>> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>> ++---
>> ++ system-linux.c | 26 ++++++++++++++++++++++++++
>> ++ system.c       |  2 ++
>> ++ system.h       |  2 ++
>> ++ 3 files changed, 30 insertions(+)
>> ++
>> ++diff --git a/system-linux.c b/system-linux.c index c5583e0..5ff8749
>> ++100644
>> ++--- a/system-linux.c
>> +++++ b/system-linux.c
>> ++@@ -3184,6 +3184,32 @@ static int system_add_vxlan(const char *name,
>> const unsigned int link, struct bl
>> ++ 	}
>> ++ 	nla_put_u16(msg, IFLA_VXLAN_PORT, htons(port));
>> ++
>> +++	if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMIN])) {
>> +++		struct ifla_vxlan_port_range srcports = {0,0};
>> +++
>> +++		uint32_t low = blobmsg_get_u32(cur);
>> +++		if (low < 1 || low > 65535 - 1) {
>> +++			ret = -EINVAL;
>> +++			goto failure;
>> +++		}
>> +++
>> +++		srcports.low = htons((uint16_t) low);
>> +++		srcports.high = htons((uint16_t) (low+1));
>> +++
>> +++		if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMAX])) {
>> +++			uint32_t high = blobmsg_get_u32(cur);
>> +++			if (high < 1 || high > 65535) {
>> +++				ret = -EINVAL;
>> +++				goto failure;
>> +++			}
>> +++			if (high > low) {
>> +++				srcports.high = htons((uint16_t) high);
>> +++			}
>> +++		}
>> +++
>> +++		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports),
>> &srcports);
>> +++	}
>> +++
>> ++ 	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
>> ++ 		bool rxcsum = blobmsg_get_bool(cur);
>> ++ 		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
>> !rxcsum); diff --git
>> ++a/system.c b/system.c index bbdfef7..4133e55 100644
>> ++--- a/system.c
>> +++++ b/system.c
>> ++@@ -38,6 +38,8 @@ static const struct blobmsg_policy
>> vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
>> ++ 	[VXLAN_DATA_ATTR_MACADDR] = { .name = "macaddr", .type =
>> BLOBMSG_TYPE_STRING },
>> ++ 	[VXLAN_DATA_ATTR_RXCSUM] = { .name = "rxcsum", .type =
>> BLOBMSG_TYPE_BOOL },
>> ++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
>> ++BLOBMSG_TYPE_BOOL },
>> +++	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type
>> = BLOBMSG_TYPE_INT32 },
>> +++	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type
>> =
>> +++BLOBMSG_TYPE_INT32 },
>> ++ };
>> ++
>> ++ const struct uci_blob_param_list vxlan_data_attr_list = { diff --git
>> ++a/system.h b/system.h index 015987f..bf9e1d7 100644
>> ++--- a/system.h
>> +++++ b/system.h
>> ++@@ -44,6 +44,8 @@ enum vxlan_data {
>> ++ 	VXLAN_DATA_ATTR_MACADDR,
>> ++ 	VXLAN_DATA_ATTR_RXCSUM,
>> ++ 	VXLAN_DATA_ATTR_TXCSUM,
>> +++	VXLAN_DATA_ATTR_SRCPORTMIN,
>> +++	VXLAN_DATA_ATTR_SRCPORTMAX,
>> ++ 	__VXLAN_DATA_ATTR_MAX
>> ++ };
>> ++
>> ++--
>> ++2.28.0
>> ++
>> +diff --git
>> +a/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>> mapp
>> +ing-of-boolean-attrs.patch
>> +b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>> mapp
>> +ing-of-boolean-attrs.patch
>> +new file mode 100644
>> +index 0000000000..a868ad64f8
>> +--- /dev/null
>> ++++ b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>> ++++ mapping-of-boolean-attrs.patch
>> +@@ -0,0 +1,59 @@
>> ++From 9b258d8c7f5140fa3e19d3e5c19b9cef84ff80f7 Mon Sep 17 00:00:00
>> 2001
>> ++From: Johannes Kimmel <fff@bareminimum.eu>
>> ++Date: Sat, 1 Aug 2020 03:59:55 +0200
>> ++Subject: [PATCH 2/3] netifd: vxlan: refactor mapping of boolean attrs
>> ++
>> ++Add a small function to handle boolean options and make use of it to
>> handle:
>> ++  - rxcsum
>> ++  - txcsum
>> ++
>> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>> ++---
>> ++ system-linux.c | 24 ++++++++++++++----------
>> ++ 1 file changed, 14 insertions(+), 10 deletions(-)
>> ++
>> ++diff --git a/system-linux.c b/system-linux.c index 5ff8749..82b65e3
>> ++100644
>> ++--- a/system-linux.c
>> +++++ b/system-linux.c
>> ++@@ -3073,6 +3073,17 @@ failure:
>> ++ #endif
>> ++
>> ++ #ifdef IFLA_VXLAN_MAX
>> +++static void system_vxlan_map_bool_attr(struct nl_msg *msg, struct
>> blob_attr **tb_data, int attrtype, int vxlandatatype, bool invert) {
>> +++	struct blob_attr *cur;
>> +++	if ((cur = tb_data[vxlandatatype])) {
>> +++		bool val = blobmsg_get_bool(cur);
>> +++		if (invert) {
>> +++			val = !val;
>> +++		}
>> +++		nla_put_u8(msg, attrtype, val);
>> +++	}
>> +++}
>> +++
>> ++ static int system_add_vxlan(const char *name, const unsigned int
>> ++link, struct blob_attr **tb, bool v6)  {
>> ++ 	struct blob_attr *tb_data[__VXLAN_DATA_ATTR_MAX]; @@ -
>> 3210,16
>> +++3221,9 @@ static int system_add_vxlan(const char *name, const
>> unsigned int link, struct bl
>> ++ 		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports),
>> &srcports);
>> ++ 	}
>> ++
>> ++-	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
>> ++-		bool rxcsum = blobmsg_get_bool(cur);
>> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
>> !rxcsum);
>> ++-	}
>> ++-
>> ++-	if ((cur = tb_data[VXLAN_DATA_ATTR_TXCSUM])) {
>> ++-		bool txcsum = blobmsg_get_bool(cur);
>> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_CSUM, txcsum);
>> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
>> !txcsum);
>> ++-	}
>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>> IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>> IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>> +++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
>> true);
>> ++
>> ++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
>> ++ 		char *str = blobmsg_get_string(cur);
>> ++--
>> ++2.28.0
>> ++
>> +diff --git
>> +a/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>> miss
>> +ing-boolean-options.patch
>> +b/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>> miss
>> +ing-boolean-options.patch
>> +new file mode 100644
>> +index 0000000000..228c0cd37f
>> +--- /dev/null
>> ++++ b/package/network/config/netifd/patches/0003-netifd-vxlan-add-
>> most-
>> ++++ missing-boolean-options.patch
>> +@@ -0,0 +1,84 @@
>> ++From 8fe4321a8d7ec7b28b7011f67c88a07584160a47 Mon Sep 17 00:00:00
>> 2001
>> ++From: Johannes Kimmel <fff@bareminimum.eu>
>> ++Date: Sat, 1 Aug 2020 04:05:31 +0200
>> ++Subject: [PATCH 3/3] netifd: vxlan: add most missing boolean options
>> ++
>> ++adds the folloing missing options:
>> ++  - learning
>> ++  - rsc
>> ++  - proxy
>> ++  - l2miss
>> ++  - l3miss
>> ++  - gbp
>> ++
>> ++See ip-link(3) for their meaning.
>> ++
>> ++still missing:
>> ++  - external
>> ++  - gpe
>> ++
>> ++I'm not sure how to handle them at the moment. It's unclear to me what
>> ++IFLA_VXLAN_* value corresponds to the 'external' option and according
>> ++to the manpage, gpe depends on it.
>> ++
>> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>> ++---
>> ++ system-linux.c | 6 ++++++
>> ++ system.c       | 6 ++++++
>> ++ system.h       | 6 ++++++
>> ++ 3 files changed, 18 insertions(+)
>> ++
>> ++diff --git a/system-linux.c b/system-linux.c index 82b65e3..d129fef
>> ++100644
>> ++--- a/system-linux.c
>> +++++ b/system-linux.c
>> ++@@ -3224,6 +3224,12 @@ static int system_add_vxlan(const char *name,
>> const unsigned int link, struct bl
>> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
>> IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
>> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
>> IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
>> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
>> ++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
>> true);
>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>> IFLA_VXLAN_LEARNING, VXLAN_DATA_ATTR_LEARNING, false);
>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_RSC ,
>> VXLAN_DATA_ATTR_RSC, false);
>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_PROXY ,
>> VXLAN_DATA_ATTR_PROXY, false);
>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L2MISS ,
>> VXLAN_DATA_ATTR_L2MISS, false);
>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L3MISS ,
>> VXLAN_DATA_ATTR_L3MISS, false);
>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_GBP ,
>> +++VXLAN_DATA_ATTR_GBP, false);
>> ++
>> ++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
>> ++ 		char *str = blobmsg_get_string(cur); diff --git a/system.c
>> ++b/system.c index 4133e55..95721e1 100644
>> ++--- a/system.c
>> +++++ b/system.c
>> ++@@ -40,6 +40,12 @@ static const struct blobmsg_policy
>> vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
>> ++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
>> BLOBMSG_TYPE_BOOL },
>> ++ 	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type
>> = BLOBMSG_TYPE_INT32 },
>> ++ 	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type
>> =
>> ++BLOBMSG_TYPE_INT32 },
>> +++	[VXLAN_DATA_ATTR_LEARNING] = { .name = "learning", .type =
>> BLOBMSG_TYPE_BOOL },
>> +++	[VXLAN_DATA_ATTR_RSC] = { .name = "rsc", .type =
>> BLOBMSG_TYPE_BOOL },
>> +++	[VXLAN_DATA_ATTR_PROXY] = { .name = "proxy", .type =
>> BLOBMSG_TYPE_BOOL },
>> +++	[VXLAN_DATA_ATTR_L2MISS] = { .name = "l2miss", .type =
>> BLOBMSG_TYPE_BOOL },
>> +++	[VXLAN_DATA_ATTR_L3MISS] = { .name = "l3miss", .type =
>> BLOBMSG_TYPE_BOOL },
>> +++	[VXLAN_DATA_ATTR_GBP] = { .name = "gbp", .type =
>> BLOBMSG_TYPE_BOOL
>> +++},
>> ++ };
>> ++
>> ++ const struct uci_blob_param_list vxlan_data_attr_list = { diff --git
>> ++a/system.h b/system.h index bf9e1d7..290c2e5 100644
>> ++--- a/system.h
>> +++++ b/system.h
>> ++@@ -46,6 +46,12 @@ enum vxlan_data {
>> ++ 	VXLAN_DATA_ATTR_TXCSUM,
>> ++ 	VXLAN_DATA_ATTR_SRCPORTMIN,
>> ++ 	VXLAN_DATA_ATTR_SRCPORTMAX,
>> +++	VXLAN_DATA_ATTR_LEARNING,
>> +++	VXLAN_DATA_ATTR_RSC,
>> +++	VXLAN_DATA_ATTR_PROXY,
>> +++	VXLAN_DATA_ATTR_L2MISS,
>> +++	VXLAN_DATA_ATTR_L3MISS,
>> +++	VXLAN_DATA_ATTR_GBP,
>> ++ 	__VXLAN_DATA_ATTR_MAX
>> ++ };
>> ++
>> ++--
>> ++2.28.0
>> ++
>> +--
>> +2.28.0
>> +
>> diff --git a/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>> b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>> new file mode 100644
>> index 0000000..97d3422
>> --- /dev/null
>> +++ b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>> @@ -0,0 +1,69 @@
>> +From a013910a253fdbaf3eccd546eb93dc10e2291689 Mon Sep 17 00:00:00
>> 2001
>> +From: Johannes Kimmel <fff@bareminimum.eu>
>> +Date: Sat, 1 Aug 2020 04:33:11 +0200
>> +Subject: [PATCH 16/16] vxlan: wire-up more options
>> +
>> +Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>> +---
>> + package/network/config/vxlan/files/vxlan.sh | 22
>> +++++++++++++++++++--
>> + 1 file changed, 20 insertions(+), 2 deletions(-)
>> +
>> +diff --git a/package/network/config/vxlan/files/vxlan.sh
>> +b/package/network/config/vxlan/files/vxlan.sh
>> +index d063c47d47..b1d106c47d 100755
>> +--- a/package/network/config/vxlan/files/vxlan.sh
>> ++++ b/package/network/config/vxlan/files/vxlan.sh
>> +@@ -59,8 +59,11 @@ vxlan_generic_setup() {
>> +
>> + 	local link="$cfg"
>> +
>> +-	local port vid ttl tos mtu macaddr zone rxcsum txcsum
>> +-	json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum
>> ++	local port srcport srcportmin srcportmax vid ttl tos mtu macaddr zone
>> rxcsum txcsum learning rsc proxy l2miss l3miss gbp
>> ++	json_get_vars port srcport vid ttl tos mtu macaddr zone rxcsum
>> txcsum
>> ++learning rsc proxy l2miss l3miss gbp
>> ++
>> ++	srcportmin=$(echo $srcport | cut -d' ' -f1)
>> ++	srcportmax=$(echo $srcport | cut -d' ' -f2)
>> +
>> + 	proto_init_update "$link" 1
>> +
>> +@@ -77,10 +80,18 @@ vxlan_generic_setup() {
>> +
>> + 	json_add_object 'data'
>> + 	[ -n "$port" ] && json_add_int port "$port"
>> ++	[ -n "$srcportmin" ] && json_add_int srcportmin "$srcportmin"
>> ++	[ -n "$srcportmax" ] && json_add_int srcportmax "$srcportmax"
>> + 	[ -n "$vid" ] && json_add_int id "$vid"
>> + 	[ -n "$macaddr" ] && json_add_string macaddr "$macaddr"
>> + 	[ -n "$rxcsum" ] && json_add_boolean rxcsum "$rxcsum"
>> + 	[ -n "$txcsum" ] && json_add_boolean txcsum "$txcsum"
>> ++	[ -n "$learning" ] && json_add_boolean learning "$learning"
>> ++	[ -n "$rsc" ] && json_add_boolean rsc "$rsc"
>> ++	[ -n "$proxy" ] && json_add_boolean proxy "$proxy"
>> ++	[ -n "$l2miss" ] && json_add_boolean l2miss "$l2miss"
>> ++	[ -n "$l3miss" ] && json_add_boolean l3miss "$l3miss"
>> ++	[ -n "$gbp" ] && json_add_boolean gbp "$gbp"
>> + 	json_close_object
>> +
>> + 	proto_close_tunnel
>> +@@ -160,11 +171,18 @@ vxlan_generic_init_config() {
>> +
>> + 	proto_config_add_int "vid"
>> + 	proto_config_add_int "port"
>> ++	proto_config_add_string "srcport"
>> + 	proto_config_add_int "ttl"
>> + 	proto_config_add_int "tos"
>> + 	proto_config_add_int "mtu"
>> + 	proto_config_add_boolean "rxcsum"
>> + 	proto_config_add_boolean "txcsum"
>> ++	proto_config_add_boolean "learning"
>> ++	proto_config_add_boolean "rsc"
>> ++	proto_config_add_boolean "proxy"
>> ++	proto_config_add_boolean "l2miss"
>> ++	proto_config_add_boolean "l3miss"
>> ++	proto_config_add_boolean "gbp"
>> + 	proto_config_add_string "macaddr"
>> + }
>> +
>> +--
>> +2.28.0
>> +
>> --
>> 2.28.0
SebaBe Aug. 2, 2020, 12:48 p.m.
Hi Lemmi,

Ich hätte da evtl nen Standort, der sich für nen Test eignet, das Erlanger Stadtmuseum.

Derzeit 5x v2 nodes, die auf einen Umbau auf Cisco APs warten.
Ethernetverkabelung weitestgehend vorhanden, einmal w2mesh ist derzeit noch nötig. 
Kann das dein System schon? 

Es sollten fast alles 1043er sein, ein oder zwei 841er könnte ich noch tauschen, wenn nötig. 
Uplink ist vdsl 50. 

Besucher sind vorhanden, nicht zu viele, aber genug für nen Test. 
Auf Zuruf kann man den ITler vor Ort sicher auch bitten, bissle Lasttests zu machen und es ist bei mir ums Eck. 

Wenn im September ein fertiges Image da ist, könnten wir den Standort gerne mal zusammen mit dem System testen. 

Bei Interesse bescheid geben,
Sebastian 

Am 1. August 2020 13:31:52 MESZ schrieb Johannes Kimmel <fff@bareminimum.eu>:
>Hi,
>
>also bei dem ganzen Umbau fehlt noch etwas, aber es ist genug, dass wir
>
>die ersten tests mit vxlan fuer fuer die Node Firmware fahren koennen. 
>Bevor ich Upstream zuballer mit dem Zeug haette ich das alles gerne 
>einmal im kleineren Rahmen ausprobiert und eventuell erkennt jetzt
>schon 
>jemand Fehler, die schon gar nicht nach Upstream muessen.
>
>Ist halt etwas schlecht von der Übersichtlichkeit, weil die patches
>fuer 
>den netifd quasi 3 Tief sind.
>
>Also patches fuer netifd sind im netifd repo entstanden, dann als 
>Patchdateien im openwrt repo in den netifd/patches Ordner gelegt und 
>diese Aenderung ist der Patch hier :)
>
>Falls es jemand moechte, kann ich die netifd patches auch mal nackig 
>hier her legen, oder vielleicht fork ich das repo mal in unserem gitea 
>und leg dort nen branch an.
>
>Auf der TODO liste sind noch:
>
> - Den automatismus entfernen, der die local ip adresse automatisch aus
>     dem tunlink ableitet. Eventuell nur dann, wenn
>         option ip6addr 'auto'
>         option tunlink 'wan6'
>   gesetzt ist. Das brauchen wir, damit sich bei aenderten prefixes bei
>     clients automatisch eine passende src adresse benutzt wird.
> - netifd/libnl3 genauer untersuchen inwiefern auf endianess aufgepasst
>     werden muss. Momentan ist das nen durcheinander und vermutlich nur
>     deswegen nicht aufgefallen, weil OpenWRT hauptsaechlich mit
>     bigendian hardware betrieben wird.
>  - Die GBP option funktioniert nicht (interface kommt nicht hoch, wenn
>     sie verwendet wird)
>   - Die letzten Paar anderen Optionen noch reinbauen, vorallem ageing.
>
>Bei den Sachen koennte ich noch etwas input gebrauchen. Im ersten Punkt
>
>Designtechnisch und vielleicht weiß bei Punkt 2 jemand die passende 
>antwort oder kann auf littleendian probieren.
>
>Naja, genug geschwafelt. Bin mal gespannt, ob vxlan der Node Firmware 
>helfen kann, also brav spielen und testen :)
>
>Gruesse,
>
>Johannes
>
>
>On 01.08.20 12:16, mail@adrianschmutzler.de wrote:
>> Hallo lemmi,
>> 
>> ich habe gesehen, dass da RFC dran steht; wenn/falls es eine
>Diskussion hier gegeben hat, sollte dies aber meiner Meinung nach
>erstmal durch Upstream durch (zumindest so, dass es mal in netifd drin
>ist).
>> 
>> Zur Diskussion selbst kann ich leider nicht viel beitragen.
>> 
>> Beste Grüße
>> 
>> Adrian
>> 
>>> -----Original Message-----
>>> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On
>Behalf
>>> Of Johannes Kimmel
>>> Sent: Samstag, 1. August 2020 05:39
>>> To: franken-dev@freifunk.net
>>> Subject: [RFC PATCH] vxlan: netifd and vxlan package patches
>>>
>>> netifd:
>>>    - add srcportmin option
>>>    - add srcportmax option (port exclusive)
>>>    - add most missing boolean options
>>>
>>> vxlan:
>>>    - wire up the new vxlan options support
>>>    - srcport
>>>          option srcport "1337 31337" # for range, max is exclusive
>>>          option srcport "1337" # for single srcport
>>>      srcport string is split before sending over to netifd to make
>>>      processing more robust on the netifd side.
>>>    - learning
>>>    - rsc
>>>    - proxy
>>>    - l2miss
>>>    - l3miss
>>>    - gbp
>>>
>>> see ip-link(3)
>>>
>>> Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>>> ---
>>>   .../openwrt/0015-netifd-vxlan-patches.patch   | 281
>++++++++++++++++++
>>>   .../0016-vxlan-wire-up-more-options.patch     |  69 +++++
>>>   2 files changed, 350 insertions(+)
>>>   create mode 100644 build_patches/openwrt/0015-netifd-vxlan-
>>> patches.patch
>>>   create mode 100644 build_patches/openwrt/0016-vxlan-wire-up-more-
>>> options.patch
>>>
>>> diff --git a/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>>> b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>>> new file mode 100644
>>> index 0000000..9861a40
>>> --- /dev/null
>>> +++ b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>>> @@ -0,0 +1,281 @@
>>> +From a86c039c41e8dab1015766c677208181f5afbf4f Mon Sep 17 00:00:00
>>> 2001
>>> +From: Johannes Kimmel <fff@bareminimum.eu>
>>> +Date: Sat, 1 Aug 2020 04:23:41 +0200
>>> +Subject: [PATCH 15/16] netifd: vxlan patches
>>> +
>>> +8fe4321 netifd: vxlan: add most missing boolean options
>>> +9b258d8 netifd: vxlan: refactor mapping of boolean attrs
>>> +84e8570 netifd: vxlan: handle srcport range
>>> +
>>> +Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>>> +---
>>> + ...01-netifd-vxlan-handle-srcport-range.patch | 98
>>> +++++++++++++++++++
>>> +...an-refactor-mapping-of-boolean-attrs.patch | 59 +++++++++++
>>> +...lan-add-most-missing-boolean-options.patch | 84 ++++++++++++++++
>>> + 3 files changed, 241 insertions(+)
>>> + create mode 100644
>>>
>+package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-
>>> +range.patch  create mode 100644
>>> +package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>>> mappin
>>> +g-of-boolean-attrs.patch  create mode 100644
>>> +package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>>> missin
>>> +g-boolean-options.patch
>>> +
>>> +diff --git
>>> +a/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>>> srcpor
>>> +t-range.patch
>>> +b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>>> srcpor
>>> +t-range.patch
>>> +new file mode 100644
>>> +index 0000000000..46cf1ef893
>>> +--- /dev/null
>>> ++++
>b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>>> sr
>>> ++++ cport-range.patch
>>> +@@ -0,0 +1,98 @@
>>> ++From 84e857013a2880362d16aa7890cd62981c152ddb Mon Sep 17 00:00:00
>>> 2001
>>> ++From: Johannes Kimmel <fff@bareminimum.eu>
>>> ++Date: Sat, 1 Aug 2020 03:38:27 +0200
>>> ++Subject: [PATCH 1/3] netifd: vxlan: handle srcport range
>>> ++
>>> ++This adds adds the ability to set the source port range for vxlan
>>> ++interfaces.
>>> ++
>>> ++By default vxlans will use a random port within the ephermal range
>as
>>> ++source ports for packets. This is done to aid scaleability within
>a
>>> ++datacenter.
>>> ++
>>> ++But with these defaults it's impossible to punch through NATs or
>>> ++traverese most stateful firewalls easily. One solution is to fix
>the
>>> ++srcport to the same as dstport.
>>> ++
>>> ++If only srcportmin is specified, then srcportmax is set in a way
>that
>>> ++outgoing packets will only use srcportmin.
>>> ++
>>> ++If a range is to be specified, srcportmin and srcportmax have to
>be
>>> ++specified. srcportmax is exclusive.
>>> ++
>>> ++If only srcportmax is specified, the value is ignored and defaults
>are
>>> ++used.
>>> ++
>>> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>>> ++---
>>> ++ system-linux.c | 26 ++++++++++++++++++++++++++
>>> ++ system.c       |  2 ++
>>> ++ system.h       |  2 ++
>>> ++ 3 files changed, 30 insertions(+)
>>> ++
>>> ++diff --git a/system-linux.c b/system-linux.c index
>c5583e0..5ff8749
>>> ++100644
>>> ++--- a/system-linux.c
>>> +++++ b/system-linux.c
>>> ++@@ -3184,6 +3184,32 @@ static int system_add_vxlan(const char
>*name,
>>> const unsigned int link, struct bl
>>> ++ 	}
>>> ++ 	nla_put_u16(msg, IFLA_VXLAN_PORT, htons(port));
>>> ++
>>> +++	if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMIN])) {
>>> +++		struct ifla_vxlan_port_range srcports = {0,0};
>>> +++
>>> +++		uint32_t low = blobmsg_get_u32(cur);
>>> +++		if (low < 1 || low > 65535 - 1) {
>>> +++			ret = -EINVAL;
>>> +++			goto failure;
>>> +++		}
>>> +++
>>> +++		srcports.low = htons((uint16_t) low);
>>> +++		srcports.high = htons((uint16_t) (low+1));
>>> +++
>>> +++		if ((cur = tb_data[VXLAN_DATA_ATTR_SRCPORTMAX])) {
>>> +++			uint32_t high = blobmsg_get_u32(cur);
>>> +++			if (high < 1 || high > 65535) {
>>> +++				ret = -EINVAL;
>>> +++				goto failure;
>>> +++			}
>>> +++			if (high > low) {
>>> +++				srcports.high = htons((uint16_t) high);
>>> +++			}
>>> +++		}
>>> +++
>>> +++		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports),
>>> &srcports);
>>> +++	}
>>> +++
>>> ++ 	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
>>> ++ 		bool rxcsum = blobmsg_get_bool(cur);
>>> ++ 		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
>>> !rxcsum); diff --git
>>> ++a/system.c b/system.c index bbdfef7..4133e55 100644
>>> ++--- a/system.c
>>> +++++ b/system.c
>>> ++@@ -38,6 +38,8 @@ static const struct blobmsg_policy
>>> vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
>>> ++ 	[VXLAN_DATA_ATTR_MACADDR] = { .name = "macaddr", .type =
>>> BLOBMSG_TYPE_STRING },
>>> ++ 	[VXLAN_DATA_ATTR_RXCSUM] = { .name = "rxcsum", .type =
>>> BLOBMSG_TYPE_BOOL },
>>> ++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
>>> ++BLOBMSG_TYPE_BOOL },
>>> +++	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type
>>> = BLOBMSG_TYPE_INT32 },
>>> +++	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type
>>> =
>>> +++BLOBMSG_TYPE_INT32 },
>>> ++ };
>>> ++
>>> ++ const struct uci_blob_param_list vxlan_data_attr_list = { diff
>--git
>>> ++a/system.h b/system.h index 015987f..bf9e1d7 100644
>>> ++--- a/system.h
>>> +++++ b/system.h
>>> ++@@ -44,6 +44,8 @@ enum vxlan_data {
>>> ++ 	VXLAN_DATA_ATTR_MACADDR,
>>> ++ 	VXLAN_DATA_ATTR_RXCSUM,
>>> ++ 	VXLAN_DATA_ATTR_TXCSUM,
>>> +++	VXLAN_DATA_ATTR_SRCPORTMIN,
>>> +++	VXLAN_DATA_ATTR_SRCPORTMAX,
>>> ++ 	__VXLAN_DATA_ATTR_MAX
>>> ++ };
>>> ++
>>> ++--
>>> ++2.28.0
>>> ++
>>> +diff --git
>>> +a/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>>> mapp
>>> +ing-of-boolean-attrs.patch
>>> +b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>>> mapp
>>> +ing-of-boolean-attrs.patch
>>> +new file mode 100644
>>> +index 0000000000..a868ad64f8
>>> +--- /dev/null
>>> ++++
>b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>>> ++++ mapping-of-boolean-attrs.patch
>>> +@@ -0,0 +1,59 @@
>>> ++From 9b258d8c7f5140fa3e19d3e5c19b9cef84ff80f7 Mon Sep 17 00:00:00
>>> 2001
>>> ++From: Johannes Kimmel <fff@bareminimum.eu>
>>> ++Date: Sat, 1 Aug 2020 03:59:55 +0200
>>> ++Subject: [PATCH 2/3] netifd: vxlan: refactor mapping of boolean
>attrs
>>> ++
>>> ++Add a small function to handle boolean options and make use of it
>to
>>> handle:
>>> ++  - rxcsum
>>> ++  - txcsum
>>> ++
>>> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>>> ++---
>>> ++ system-linux.c | 24 ++++++++++++++----------
>>> ++ 1 file changed, 14 insertions(+), 10 deletions(-)
>>> ++
>>> ++diff --git a/system-linux.c b/system-linux.c index
>5ff8749..82b65e3
>>> ++100644
>>> ++--- a/system-linux.c
>>> +++++ b/system-linux.c
>>> ++@@ -3073,6 +3073,17 @@ failure:
>>> ++ #endif
>>> ++
>>> ++ #ifdef IFLA_VXLAN_MAX
>>> +++static void system_vxlan_map_bool_attr(struct nl_msg *msg, struct
>>> blob_attr **tb_data, int attrtype, int vxlandatatype, bool invert) {
>>> +++	struct blob_attr *cur;
>>> +++	if ((cur = tb_data[vxlandatatype])) {
>>> +++		bool val = blobmsg_get_bool(cur);
>>> +++		if (invert) {
>>> +++			val = !val;
>>> +++		}
>>> +++		nla_put_u8(msg, attrtype, val);
>>> +++	}
>>> +++}
>>> +++
>>> ++ static int system_add_vxlan(const char *name, const unsigned int
>>> ++link, struct blob_attr **tb, bool v6)  {
>>> ++ 	struct blob_attr *tb_data[__VXLAN_DATA_ATTR_MAX]; @@ -
>>> 3210,16
>>> +++3221,9 @@ static int system_add_vxlan(const char *name, const
>>> unsigned int link, struct bl
>>> ++ 		nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports),
>>> &srcports);
>>> ++ 	}
>>> ++
>>> ++-	if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
>>> ++-		bool rxcsum = blobmsg_get_bool(cur);
>>> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
>>> !rxcsum);
>>> ++-	}
>>> ++-
>>> ++-	if ((cur = tb_data[VXLAN_DATA_ATTR_TXCSUM])) {
>>> ++-		bool txcsum = blobmsg_get_bool(cur);
>>> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_CSUM, txcsum);
>>> ++-		nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
>>> !txcsum);
>>> ++-	}
>>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>>> IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>>> IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>>> +++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
>>> true);
>>> ++
>>> ++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
>>> ++ 		char *str = blobmsg_get_string(cur);
>>> ++--
>>> ++2.28.0
>>> ++
>>> +diff --git
>>> +a/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>>> miss
>>> +ing-boolean-options.patch
>>> +b/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>>> miss
>>> +ing-boolean-options.patch
>>> +new file mode 100644
>>> +index 0000000000..228c0cd37f
>>> +--- /dev/null
>>> ++++ b/package/network/config/netifd/patches/0003-netifd-vxlan-add-
>>> most-
>>> ++++ missing-boolean-options.patch
>>> +@@ -0,0 +1,84 @@
>>> ++From 8fe4321a8d7ec7b28b7011f67c88a07584160a47 Mon Sep 17 00:00:00
>>> 2001
>>> ++From: Johannes Kimmel <fff@bareminimum.eu>
>>> ++Date: Sat, 1 Aug 2020 04:05:31 +0200
>>> ++Subject: [PATCH 3/3] netifd: vxlan: add most missing boolean
>options
>>> ++
>>> ++adds the folloing missing options:
>>> ++  - learning
>>> ++  - rsc
>>> ++  - proxy
>>> ++  - l2miss
>>> ++  - l3miss
>>> ++  - gbp
>>> ++
>>> ++See ip-link(3) for their meaning.
>>> ++
>>> ++still missing:
>>> ++  - external
>>> ++  - gpe
>>> ++
>>> ++I'm not sure how to handle them at the moment. It's unclear to me
>what
>>> ++IFLA_VXLAN_* value corresponds to the 'external' option and
>according
>>> ++to the manpage, gpe depends on it.
>>> ++
>>> ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>>> ++---
>>> ++ system-linux.c | 6 ++++++
>>> ++ system.c       | 6 ++++++
>>> ++ system.h       | 6 ++++++
>>> ++ 3 files changed, 18 insertions(+)
>>> ++
>>> ++diff --git a/system-linux.c b/system-linux.c index
>82b65e3..d129fef
>>> ++100644
>>> ++--- a/system-linux.c
>>> +++++ b/system-linux.c
>>> ++@@ -3224,6 +3224,12 @@ static int system_add_vxlan(const char
>*name,
>>> const unsigned int link, struct bl
>>> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
>>> IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
>>> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
>>> IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
>>> ++ 	system_vxlan_map_bool_attr(msg, tb_data,
>>> ++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
>>> true);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data,
>>> IFLA_VXLAN_LEARNING, VXLAN_DATA_ATTR_LEARNING, false);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_RSC ,
>>> VXLAN_DATA_ATTR_RSC, false);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_PROXY ,
>>> VXLAN_DATA_ATTR_PROXY, false);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L2MISS ,
>>> VXLAN_DATA_ATTR_L2MISS, false);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L3MISS ,
>>> VXLAN_DATA_ATTR_L3MISS, false);
>>> +++	system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_GBP ,
>>> +++VXLAN_DATA_ATTR_GBP, false);
>>> ++
>>> ++ 	if ((cur = tb[TUNNEL_ATTR_TOS])) {
>>> ++ 		char *str = blobmsg_get_string(cur); diff --git a/system.c
>>> ++b/system.c index 4133e55..95721e1 100644
>>> ++--- a/system.c
>>> +++++ b/system.c
>>> ++@@ -40,6 +40,12 @@ static const struct blobmsg_policy
>>> vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
>>> ++ 	[VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
>>> BLOBMSG_TYPE_BOOL },
>>> ++ 	[VXLAN_DATA_ATTR_SRCPORTMIN] = { .name = "srcportmin", .type
>>> = BLOBMSG_TYPE_INT32 },
>>> ++ 	[VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax", .type
>>> =
>>> ++BLOBMSG_TYPE_INT32 },
>>> +++	[VXLAN_DATA_ATTR_LEARNING] = { .name = "learning", .type =
>>> BLOBMSG_TYPE_BOOL },
>>> +++	[VXLAN_DATA_ATTR_RSC] = { .name = "rsc", .type =
>>> BLOBMSG_TYPE_BOOL },
>>> +++	[VXLAN_DATA_ATTR_PROXY] = { .name = "proxy", .type =
>>> BLOBMSG_TYPE_BOOL },
>>> +++	[VXLAN_DATA_ATTR_L2MISS] = { .name = "l2miss", .type =
>>> BLOBMSG_TYPE_BOOL },
>>> +++	[VXLAN_DATA_ATTR_L3MISS] = { .name = "l3miss", .type =
>>> BLOBMSG_TYPE_BOOL },
>>> +++	[VXLAN_DATA_ATTR_GBP] = { .name = "gbp", .type =
>>> BLOBMSG_TYPE_BOOL
>>> +++},
>>> ++ };
>>> ++
>>> ++ const struct uci_blob_param_list vxlan_data_attr_list = { diff
>--git
>>> ++a/system.h b/system.h index bf9e1d7..290c2e5 100644
>>> ++--- a/system.h
>>> +++++ b/system.h
>>> ++@@ -46,6 +46,12 @@ enum vxlan_data {
>>> ++ 	VXLAN_DATA_ATTR_TXCSUM,
>>> ++ 	VXLAN_DATA_ATTR_SRCPORTMIN,
>>> ++ 	VXLAN_DATA_ATTR_SRCPORTMAX,
>>> +++	VXLAN_DATA_ATTR_LEARNING,
>>> +++	VXLAN_DATA_ATTR_RSC,
>>> +++	VXLAN_DATA_ATTR_PROXY,
>>> +++	VXLAN_DATA_ATTR_L2MISS,
>>> +++	VXLAN_DATA_ATTR_L3MISS,
>>> +++	VXLAN_DATA_ATTR_GBP,
>>> ++ 	__VXLAN_DATA_ATTR_MAX
>>> ++ };
>>> ++
>>> ++--
>>> ++2.28.0
>>> ++
>>> +--
>>> +2.28.0
>>> +
>>> diff --git
>a/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>>> b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>>> new file mode 100644
>>> index 0000000..97d3422
>>> --- /dev/null
>>> +++ b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>>> @@ -0,0 +1,69 @@
>>> +From a013910a253fdbaf3eccd546eb93dc10e2291689 Mon Sep 17 00:00:00
>>> 2001
>>> +From: Johannes Kimmel <fff@bareminimum.eu>
>>> +Date: Sat, 1 Aug 2020 04:33:11 +0200
>>> +Subject: [PATCH 16/16] vxlan: wire-up more options
>>> +
>>> +Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>>> +---
>>> + package/network/config/vxlan/files/vxlan.sh | 22
>>> +++++++++++++++++++--
>>> + 1 file changed, 20 insertions(+), 2 deletions(-)
>>> +
>>> +diff --git a/package/network/config/vxlan/files/vxlan.sh
>>> +b/package/network/config/vxlan/files/vxlan.sh
>>> +index d063c47d47..b1d106c47d 100755
>>> +--- a/package/network/config/vxlan/files/vxlan.sh
>>> ++++ b/package/network/config/vxlan/files/vxlan.sh
>>> +@@ -59,8 +59,11 @@ vxlan_generic_setup() {
>>> +
>>> + 	local link="$cfg"
>>> +
>>> +-	local port vid ttl tos mtu macaddr zone rxcsum txcsum
>>> +-	json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum
>>> ++	local port srcport srcportmin srcportmax vid ttl tos mtu macaddr
>zone
>>> rxcsum txcsum learning rsc proxy l2miss l3miss gbp
>>> ++	json_get_vars port srcport vid ttl tos mtu macaddr zone rxcsum
>>> txcsum
>>> ++learning rsc proxy l2miss l3miss gbp
>>> ++
>>> ++	srcportmin=$(echo $srcport | cut -d' ' -f1)
>>> ++	srcportmax=$(echo $srcport | cut -d' ' -f2)
>>> +
>>> + 	proto_init_update "$link" 1
>>> +
>>> +@@ -77,10 +80,18 @@ vxlan_generic_setup() {
>>> +
>>> + 	json_add_object 'data'
>>> + 	[ -n "$port" ] && json_add_int port "$port"
>>> ++	[ -n "$srcportmin" ] && json_add_int srcportmin "$srcportmin"
>>> ++	[ -n "$srcportmax" ] && json_add_int srcportmax "$srcportmax"
>>> + 	[ -n "$vid" ] && json_add_int id "$vid"
>>> + 	[ -n "$macaddr" ] && json_add_string macaddr "$macaddr"
>>> + 	[ -n "$rxcsum" ] && json_add_boolean rxcsum "$rxcsum"
>>> + 	[ -n "$txcsum" ] && json_add_boolean txcsum "$txcsum"
>>> ++	[ -n "$learning" ] && json_add_boolean learning "$learning"
>>> ++	[ -n "$rsc" ] && json_add_boolean rsc "$rsc"
>>> ++	[ -n "$proxy" ] && json_add_boolean proxy "$proxy"
>>> ++	[ -n "$l2miss" ] && json_add_boolean l2miss "$l2miss"
>>> ++	[ -n "$l3miss" ] && json_add_boolean l3miss "$l3miss"
>>> ++	[ -n "$gbp" ] && json_add_boolean gbp "$gbp"
>>> + 	json_close_object
>>> +
>>> + 	proto_close_tunnel
>>> +@@ -160,11 +171,18 @@ vxlan_generic_init_config() {
>>> +
>>> + 	proto_config_add_int "vid"
>>> + 	proto_config_add_int "port"
>>> ++	proto_config_add_string "srcport"
>>> + 	proto_config_add_int "ttl"
>>> + 	proto_config_add_int "tos"
>>> + 	proto_config_add_int "mtu"
>>> + 	proto_config_add_boolean "rxcsum"
>>> + 	proto_config_add_boolean "txcsum"
>>> ++	proto_config_add_boolean "learning"
>>> ++	proto_config_add_boolean "rsc"
>>> ++	proto_config_add_boolean "proxy"
>>> ++	proto_config_add_boolean "l2miss"
>>> ++	proto_config_add_boolean "l3miss"
>>> ++	proto_config_add_boolean "gbp"
>>> + 	proto_config_add_string "macaddr"
>>> + }
>>> +
>>> +--
>>> +2.28.0
>>> +
>>> --
>>> 2.28.0
Johannes Kimmel Aug. 3, 2020, 4:20 a.m.
Hi,

dank Robert gibt es schon den ersten Testrouter und mit der Motivation 
habe ich die Patches ueberarbeitet, sodass wir eigentlich jetzt alle 
Bausteine haben um die Node Firmware mit vxlan nachzuruesten und damit 
eine Alternative zu fastd zu schaffen.

Laut Robert schaffen damit die 1043er (v4) ne 100er Leitung voll zu 
machen, statt bei 25Mbps schon in die Knie zu gehen.

Fuer die Node Firmware gibt es aber (noch) folgendes zu beachten:

  * Uplink muss im Idealfall IPv6 koennen.
  * Falls nur v4 vorhanden ist, kann maximal 1 (zufaelliger) Router
    hinter NAT einen vxlan tunnel aufmachen.
    (Grob: der Grund liegt darin wie vxlan mit Ports umgeht und uebliche
    stateful Firewalls und NATs machen das kaputt)
  * Wir muessen noch das naechste Batman update abwarten. Damit kann man
    gezielt Interfaces bevorzugen. Man wuerde einfach auf den Geraeten
    saemtliche Tunnel aufbauen und das Batman waehlt immer die
    schnellste Technologie, die gerade funktioniert. Ohne das Update
    wirds Zufall, oder man muss fastd abschalten um vxlan zu erzwingen,
    dann hat man aber keinen Fallback mehr.
    https://git.open-mesh.org/batman-adv.git/commit/921f23df8a26fa49f12f58dd8409f56e2b89e7d5

Wie vxlan in der Layer 3 Firmware verwendet werden kann (der eigentliche 
Grund fuer diese ganze Mission) fasse ich zu einem spaeteren Zeitpunkt 
noch einmal zusammen, wenn ich dafuer die ersten Patches fuer die 
gatewayconfig geschrieben habe und der Haßfurtaufbau steht.

Gruesse,

Johannes

On 02.08.20 14:48, SebaBe wrote:
> Hi Lemmi,
>
> Ich hätte da evtl nen Standort, der sich für nen Test eignet, das 
> Erlanger Stadtmuseum.
>
> Derzeit 5x v2 nodes, die auf einen Umbau auf Cisco APs warten.
> Ethernetverkabelung weitestgehend vorhanden, einmal w2mesh ist derzeit 
> noch nötig.
> Kann das dein System schon?
>
> Es sollten fast alles 1043er sein, ein oder zwei 841er könnte ich noch 
> tauschen, wenn nötig.
> Uplink ist vdsl 50.
>
> Besucher sind vorhanden, nicht zu viele, aber genug für nen Test.
> Auf Zuruf kann man den ITler vor Ort sicher auch bitten, bissle 
> Lasttests zu machen und es ist bei mir ums Eck.
>
> Wenn im September ein fertiges Image da ist, könnten wir den Standort 
> gerne mal zusammen mit dem System testen.
>
> Bei Interesse bescheid geben,
> Sebastian
>
> Am 1. August 2020 13:31:52 MESZ schrieb Johannes Kimmel 
> <fff@bareminimum.eu>:
>
>     Hi,
>
>     also bei dem ganzen Umbau fehlt noch etwas, aber es ist genug, dass wir
>     die ersten tests mit vxlan fuer fuer die Node Firmware fahren koennen.
>     Bevor ich Upstream zuballer mit dem Zeug haette ich das alles gerne
>     einmal im kleineren Rahmen ausprobiert und eventuell erkennt jetzt schon
>     jemand Fehler, die schon gar nicht nach Upstream muessen.
>
>     Ist halt etwas schlecht von der Übersichtlichkeit, weil die patches fuer
>     den netifd quasi 3 Tief sind.
>
>     Also patches fuer netifd sind im netifd repo entstanden, dann als
>     Patchdateien im openwrt repo in den netifd/patches Ordner gelegt und
>     diese Aenderung ist der Patch hier :)
>
>     Falls es jemand moechte, kann ich die netifd patches auch mal nackig
>     hier her legen, oder vielleicht fork ich das repo mal in unserem gitea
>     und leg dort nen branch an.
>
>     Auf der TODO liste sind noch:
>
>         - Den automatismus entfernen, der die local ip adresse automatisch aus
>           dem tunlink ableitet. Eventuell nur dann, wenn
>               option ip6addr 'auto'
>               option tunlink 'wan6'
>           gesetzt ist. Das brauchen wir, damit sich bei aenderten prefixes bei
>           clients automatisch eine passende src adresse benutzt wird.
>         - netifd/libnl3 genauer untersuchen inwiefern auf endianess aufgepasst
>           werden muss. Momentan ist das nen durcheinander und vermutlich nur
>           deswegen nicht aufgefallen, weil OpenWRT hauptsaechlich mit
>           bigendian hardware betrieben wird.
>         - Die GBP option funktioniert nicht (interface kommt nicht hoch, wenn
>           sie verwendet wird)
>         - Die letzten Paar anderen Optionen noch reinbauen, vorallem ageing.
>
>     Bei den Sachen koennte ich noch etwas input gebrauchen. Im ersten Punkt
>     Designtechnisch und vielleicht weiß bei Punkt 2 jemand die passende
>     antwort oder kann auf littleendian probieren.
>
>     Naja, genug geschwafelt. Bin mal gespannt, ob vxlan der Node Firmware
>     helfen kann, also brav spielen und testen :)
>
>     Gruesse,
>
>     Johannes
>
>
>     On 01.08.20 12:16, mail@adrianschmutzler.de wrote:
>
>         Hallo lemmi, ich habe gesehen, dass da RFC dran steht;
>         wenn/falls es eine Diskussion hier gegeben hat, sollte dies
>         aber meiner Meinung nach erstmal durch Upstream durch
>         (zumindest so, dass es mal in netifd drin ist). Zur Diskussion
>         selbst kann ich leider nicht viel beitragen. Beste Grüße Adrian
>
>             -----Original Message----- From: franken-dev
>             [mailto:franken-dev-bounces@freifunk.net] On Behalf Of
>             Johannes Kimmel Sent: Samstag, 1. August 2020 05:39 To:
>             franken-dev@freifunk.net Subject: [RFC PATCH] vxlan:
>             netifd and vxlan package patches netifd: - add srcportmin
>             option - add srcportmax option (port exclusive) - add most
>             missing boolean options vxlan: - wire up the new vxlan
>             options support - srcport option srcport "1337 31337" #
>             for range, max is exclusive option srcport "1337" # for
>             single srcport srcport string is split before sending over
>             to netifd to make processing more robust on the netifd
>             side. - learning - rsc - proxy - l2miss - l3miss - gbp see
>             ip-link(3) Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>             ------------------------------------------------------------------------
>             .../openwrt/0015-netifd-vxlan-patches.patch | 281
>             ++++++++++++++++++
>             .../0016-vxlan-wire-up-more-options.patch | 69 +++++ 2
>             files changed, 350 insertions(+) create mode 100644
>             build_patches/openwrt/0015-netifd-vxlan- patches.patch
>             create mode 100644
>             build_patches/openwrt/0016-vxlan-wire-up-more-
>             options.patch diff --git
>             a/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>             b/build_patches/openwrt/0015-netifd-vxlan-patches.patch
>             new file mode 100644 index 0000000..9861a40 --- /dev/null
>             +++
>             b/build_patches/openwrt/0015-netifd-vxlan-patches.patch @@
>             -0,0 +1,281 @@ +From
>             a86c039c41e8dab1015766c677208181f5afbf4f Mon Sep 17
>             00:00:00 2001 +From: Johannes Kimmel <fff@bareminimum.eu>
>             +Date: Sat, 1 Aug 2020 04:23:41 +0200 +Subject: [PATCH
>             15/16] netifd: vxlan patches + +8fe4321 netifd: vxlan: add
>             most missing boolean options +9b258d8 netifd: vxlan:
>             refactor mapping of boolean attrs +84e8570 netifd: vxlan:
>             handle srcport range + +Signed-off-by: Johannes Kimmel
>             <fff@bareminimum.eu> +--- +
>             ...01-netifd-vxlan-handle-srcport-range.patch | 98
>             +++++++++++++++++++
>             +...an-refactor-mapping-of-boolean-attrs.patch | 59
>             +++++++++++ +...lan-add-most-missing-boolean-options.patch
>             | 84 ++++++++++++++++ + 3 files changed, 241 insertions(+)
>             + create mode 100644
>             +package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-
>             +range.patch create mode 100644
>             +package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>             mappin +g-of-boolean-attrs.patch create mode 100644
>             +package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>             missin +g-boolean-options.patch + +diff --git
>             +a/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>             srcpor +t-range.patch
>             +b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>             srcpor +t-range.patch +new file mode 100644 +index
>             0000000000..46cf1ef893 +--- /dev/null ++++
>             b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-
>             sr ++++ cport-range.patch +@@ -0,0 +1,98 @@ ++From
>             84e857013a2880362d16aa7890cd62981c152ddb Mon Sep 17
>             00:00:00 2001 ++From: Johannes Kimmel <fff@bareminimum.eu>
>             ++Date: Sat, 1 Aug 2020 03:38:27 +0200 ++Subject: [PATCH
>             1/3] netifd: vxlan: handle srcport range ++ ++This adds
>             adds the ability to set the source port range for vxlan
>             ++interfaces. ++ ++By default vxlans will use a random
>             port within the ephermal range as ++source ports for
>             packets. This is done to aid scaleability within a
>             ++datacenter. ++ ++But with these defaults it's impossible
>             to punch through NATs or ++traverese most stateful
>             firewalls easily. One solution is to fix the ++srcport to
>             the same as dstport. ++ ++If only srcportmin is specified,
>             then srcportmax is set in a way that ++outgoing packets
>             will only use srcportmin. ++ ++If a range is to be
>             specified, srcportmin and srcportmax have to be
>             ++specified. srcportmax is exclusive. ++ ++If only
>             srcportmax is specified, the value is ignored and defaults
>             are ++used. ++ ++Signed-off-by: Johannes Kimmel
>             <fff@bareminimum.eu> ++--- ++ system-linux.c | 26
>             ++++++++++++++++++++++++++ ++ system.c | 2 ++ ++ system.h
>             | 2 ++ ++ 3 files changed, 30 insertions(+) ++ ++diff
>             --git a/system-linux.c b/system-linux.c index
>             c5583e0..5ff8749 ++100644 ++--- a/system-linux.c +++++
>             b/system-linux.c ++@@ -3184,6 +3184,32 @@ static int
>             system_add_vxlan(const char *name, const unsigned int
>             link, struct bl ++ } ++ nla_put_u16(msg, IFLA_VXLAN_PORT,
>             htons(port)); ++ +++ if ((cur =
>             tb_data[VXLAN_DATA_ATTR_SRCPORTMIN])) { +++ struct
>             ifla_vxlan_port_range srcports = {0,0}; +++ +++ uint32_t
>             low = blobmsg_get_u32(cur); +++ if (low < 1 || low > 65535
>             - 1) { +++ ret = -EINVAL; +++ goto failure; +++ } +++ +++
>             srcports.low = htons((uint16_t) low); +++ srcports.high =
>             htons((uint16_t) (low+1)); +++ +++ if ((cur =
>             tb_data[VXLAN_DATA_ATTR_SRCPORTMAX])) { +++ uint32_t high
>             = blobmsg_get_u32(cur); +++ if (high < 1 || high > 65535)
>             { +++ ret = -EINVAL; +++ goto failure; +++ } +++ if (high
>             > low) { +++ srcports.high = htons((uint16_t) high); +++ }
>             +++ } +++ +++ nla_put(msg, IFLA_VXLAN_PORT_RANGE,
>             sizeof(srcports), &srcports); +++ } +++ ++ if ((cur =
>             tb_data[VXLAN_DATA_ATTR_RXCSUM])) { ++ bool rxcsum =
>             blobmsg_get_bool(cur); ++ nla_put_u8(msg,
>             IFLA_VXLAN_UDP_ZERO_CSUM6_RX, !rxcsum); diff --git
>             ++a/system.c b/system.c index bbdfef7..4133e55 100644
>             ++--- a/system.c +++++ b/system.c ++@@ -38,6 +38,8 @@
>             static const struct blobmsg_policy
>             vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = { ++
>             [VXLAN_DATA_ATTR_MACADDR] = { .name = "macaddr", .type =
>             BLOBMSG_TYPE_STRING }, ++ [VXLAN_DATA_ATTR_RXCSUM] = {
>             .name = "rxcsum", .type = BLOBMSG_TYPE_BOOL }, ++
>             [VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
>             ++BLOBMSG_TYPE_BOOL }, +++ [VXLAN_DATA_ATTR_SRCPORTMIN] =
>             { .name = "srcportmin", .type = BLOBMSG_TYPE_INT32 }, +++
>             [VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax",
>             .type = +++BLOBMSG_TYPE_INT32 }, ++ }; ++ ++ const struct
>             uci_blob_param_list vxlan_data_attr_list = { diff --git
>             ++a/system.h b/system.h index 015987f..bf9e1d7 100644
>             ++--- a/system.h +++++ b/system.h ++@@ -44,6 +44,8 @@ enum
>             vxlan_data { ++ VXLAN_DATA_ATTR_MACADDR, ++
>             VXLAN_DATA_ATTR_RXCSUM, ++ VXLAN_DATA_ATTR_TXCSUM, +++
>             VXLAN_DATA_ATTR_SRCPORTMIN, +++
>             VXLAN_DATA_ATTR_SRCPORTMAX, ++ __VXLAN_DATA_ATTR_MAX ++ };
>             ++ ++-- ++2.28.0 ++ +diff --git
>             +a/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>             mapp +ing-of-boolean-attrs.patch
>             +b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>             mapp +ing-of-boolean-attrs.patch +new file mode 100644
>             +index 0000000000..a868ad64f8 +--- /dev/null ++++
>             b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-
>             ++++ mapping-of-boolean-attrs.patch +@@ -0,0 +1,59 @@
>             ++From 9b258d8c7f5140fa3e19d3e5c19b9cef84ff80f7 Mon Sep 17
>             00:00:00 2001 ++From: Johannes Kimmel <fff@bareminimum.eu>
>             ++Date: Sat, 1 Aug 2020 03:59:55 +0200 ++Subject: [PATCH
>             2/3] netifd: vxlan: refactor mapping of boolean attrs ++
>             ++Add a small function to handle boolean options and make
>             use of it to handle: ++ - rxcsum ++ - txcsum ++
>             ++Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
>             ++--- ++ system-linux.c | 24 ++++++++++++++---------- ++ 1
>             file changed, 14 insertions(+), 10 deletions(-) ++ ++diff
>             --git a/system-linux.c b/system-linux.c index
>             5ff8749..82b65e3 ++100644 ++--- a/system-linux.c +++++
>             b/system-linux.c ++@@ -3073,6 +3073,17 @@ failure: ++
>             #endif ++ ++ #ifdef IFLA_VXLAN_MAX +++static void
>             system_vxlan_map_bool_attr(struct nl_msg *msg, struct
>             blob_attr **tb_data, int attrtype, int vxlandatatype, bool
>             invert) { +++ struct blob_attr *cur; +++ if ((cur =
>             tb_data[vxlandatatype])) { +++ bool val =
>             blobmsg_get_bool(cur); +++ if (invert) { +++ val = !val;
>             +++ } +++ nla_put_u8(msg, attrtype, val); +++ } +++} +++
>             ++ static int system_add_vxlan(const char *name, const
>             unsigned int ++link, struct blob_attr **tb, bool v6) { ++
>             struct blob_attr *tb_data[__VXLAN_DATA_ATTR_MAX]; @@ -
>             3210,16 +++3221,9 @@ static int system_add_vxlan(const
>             char *name, const unsigned int link, struct bl ++
>             nla_put(msg, IFLA_VXLAN_PORT_RANGE, sizeof(srcports),
>             &srcports); ++ } ++ ++- if ((cur =
>             tb_data[VXLAN_DATA_ATTR_RXCSUM])) { ++- bool rxcsum =
>             blobmsg_get_bool(cur); ++- nla_put_u8(msg,
>             IFLA_VXLAN_UDP_ZERO_CSUM6_RX, !rxcsum); ++- } ++- ++- if
>             ((cur = tb_data[VXLAN_DATA_ATTR_TXCSUM])) { ++- bool
>             txcsum = blobmsg_get_bool(cur); ++- nla_put_u8(msg,
>             IFLA_VXLAN_UDP_CSUM, txcsum); ++- nla_put_u8(msg,
>             IFLA_VXLAN_UDP_ZERO_CSUM6_TX, !txcsum); ++- } +++
>             system_vxlan_map_bool_attr(msg, tb_data,
>             IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM,
>             true); +++ system_vxlan_map_bool_attr(msg, tb_data,
>             IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false); +++
>             system_vxlan_map_bool_attr(msg, tb_data,
>             +++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
>             true); ++ ++ if ((cur = tb[TUNNEL_ATTR_TOS])) { ++ char
>             *str = blobmsg_get_string(cur); ++-- ++2.28.0 ++ +diff
>             --git
>             +a/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>             miss +ing-boolean-options.patch
>             +b/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-
>             miss +ing-boolean-options.patch +new file mode 100644
>             +index 0000000000..228c0cd37f +--- /dev/null ++++
>             b/package/network/config/netifd/patches/0003-netifd-vxlan-add-
>             most- ++++ missing-boolean-options.patch +@@ -0,0 +1,84 @@
>             ++From 8fe4321a8d7ec7b28b7011f67c88a07584160a47 Mon Sep 17
>             00:00:00 2001 ++From: Johannes Kimmel <fff@bareminimum.eu>
>             ++Date: Sat, 1 Aug 2020 04:05:31 +0200 ++Subject: [PATCH
>             3/3] netifd: vxlan: add most missing boolean options ++
>             ++adds the folloing missing options: ++ - learning ++ -
>             rsc ++ - proxy ++ - l2miss ++ - l3miss ++ - gbp ++ ++See
>             ip-link(3) for their meaning. ++ ++still missing: ++ -
>             external ++ - gpe ++ ++I'm not sure how to handle them at
>             the moment. It's unclear to me what ++IFLA_VXLAN_* value
>             corresponds to the 'external' option and according ++to
>             the manpage, gpe depends on it. ++ ++Signed-off-by:
>             Johannes Kimmel <fff@bareminimum.eu> ++--- ++
>             system-linux.c | 6 ++++++ ++ system.c | 6 ++++++ ++
>             system.h | 6 ++++++ ++ 3 files changed, 18 insertions(+)
>             ++ ++diff --git a/system-linux.c b/system-linux.c index
>             82b65e3..d129fef ++100644 ++--- a/system-linux.c +++++
>             b/system-linux.c ++@@ -3224,6 +3224,12 @@ static int
>             system_add_vxlan(const char *name, const unsigned int
>             link, struct bl ++ system_vxlan_map_bool_attr(msg,
>             tb_data, IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
>             VXLAN_DATA_ATTR_RXCSUM, true); ++
>             system_vxlan_map_bool_attr(msg, tb_data,
>             IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false); ++
>             system_vxlan_map_bool_attr(msg, tb_data,
>             ++IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM,
>             true); +++ system_vxlan_map_bool_attr(msg, tb_data,
>             IFLA_VXLAN_LEARNING, VXLAN_DATA_ATTR_LEARNING, false); +++
>             system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_RSC ,
>             VXLAN_DATA_ATTR_RSC, false); +++
>             system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_PROXY
>             , VXLAN_DATA_ATTR_PROXY, false); +++
>             system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L2MISS
>             , VXLAN_DATA_ATTR_L2MISS, false); +++
>             system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L3MISS
>             , VXLAN_DATA_ATTR_L3MISS, false); +++
>             system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_GBP ,
>             +++VXLAN_DATA_ATTR_GBP, false); ++ ++ if ((cur =
>             tb[TUNNEL_ATTR_TOS])) { ++ char *str =
>             blobmsg_get_string(cur); diff --git a/system.c
>             ++b/system.c index 4133e55..95721e1 100644 ++---
>             a/system.c +++++ b/system.c ++@@ -40,6 +40,12 @@ static
>             const struct blobmsg_policy
>             vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = { ++
>             [VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type =
>             BLOBMSG_TYPE_BOOL }, ++ [VXLAN_DATA_ATTR_SRCPORTMIN] = {
>             .name = "srcportmin", .type = BLOBMSG_TYPE_INT32 }, ++
>             [VXLAN_DATA_ATTR_SRCPORTMAX] = { .name = "srcportmax",
>             .type = ++BLOBMSG_TYPE_INT32 }, +++
>             [VXLAN_DATA_ATTR_LEARNING] = { .name = "learning", .type =
>             BLOBMSG_TYPE_BOOL }, +++ [VXLAN_DATA_ATTR_RSC] = { .name =
>             "rsc", .type = BLOBMSG_TYPE_BOOL }, +++
>             [VXLAN_DATA_ATTR_PROXY] = { .name = "proxy", .type =
>             BLOBMSG_TYPE_BOOL }, +++ [VXLAN_DATA_ATTR_L2MISS] = {
>             .name = "l2miss", .type = BLOBMSG_TYPE_BOOL }, +++
>             [VXLAN_DATA_ATTR_L3MISS] = { .name = "l3miss", .type =
>             BLOBMSG_TYPE_BOOL }, +++ [VXLAN_DATA_ATTR_GBP] = { .name =
>             "gbp", .type = BLOBMSG_TYPE_BOOL +++}, ++ }; ++ ++ const
>             struct uci_blob_param_list vxlan_data_attr_list = { diff
>             --git ++a/system.h b/system.h index bf9e1d7..290c2e5
>             100644 ++--- a/system.h +++++ b/system.h ++@@ -46,6 +46,12
>             @@ enum vxlan_data { ++ VXLAN_DATA_ATTR_TXCSUM, ++
>             VXLAN_DATA_ATTR_SRCPORTMIN, ++ VXLAN_DATA_ATTR_SRCPORTMAX,
>             +++ VXLAN_DATA_ATTR_LEARNING, +++ VXLAN_DATA_ATTR_RSC, +++
>             VXLAN_DATA_ATTR_PROXY, +++ VXLAN_DATA_ATTR_L2MISS, +++
>             VXLAN_DATA_ATTR_L3MISS, +++ VXLAN_DATA_ATTR_GBP, ++
>             __VXLAN_DATA_ATTR_MAX ++ }; ++ ++-- ++2.28.0 ++ +--
>             +2.28.0 + diff --git
>             a/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>             b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>             new file mode 100644 index 0000000..97d3422 --- /dev/null
>             +++
>             b/build_patches/openwrt/0016-vxlan-wire-up-more-options.patch
>             @@ -0,0 +1,69 @@ +From
>             a013910a253fdbaf3eccd546eb93dc10e2291689 Mon Sep 17
>             00:00:00 2001 +From: Johannes Kimmel <fff@bareminimum.eu>
>             +Date: Sat, 1 Aug 2020 04:33:11 +0200 +Subject: [PATCH
>             16/16] vxlan: wire-up more options + +Signed-off-by:
>             Johannes Kimmel <fff@bareminimum.eu> +--- +
>             package/network/config/vxlan/files/vxlan.sh | 22
>             +++++++++++++++++++-- + 1 file changed, 20 insertions(+),
>             2 deletions(-) + +diff --git
>             a/package/network/config/vxlan/files/vxlan.sh
>             +b/package/network/config/vxlan/files/vxlan.sh +index
>             d063c47d47..b1d106c47d 100755 +---
>             a/package/network/config/vxlan/files/vxlan.sh ++++
>             b/package/network/config/vxlan/files/vxlan.sh +@@ -59,8
>             +59,11 @@ vxlan_generic_setup() { + + local link="$cfg" +
>             +- local port vid ttl tos mtu macaddr zone rxcsum txcsum
>             +- json_get_vars port vid ttl tos mtu macaddr zone rxcsum
>             txcsum ++ local port srcport srcportmin srcportmax vid ttl
>             tos mtu macaddr zone rxcsum txcsum learning rsc proxy
>             l2miss l3miss gbp ++ json_get_vars port srcport vid ttl
>             tos mtu macaddr zone rxcsum txcsum ++learning rsc proxy
>             l2miss l3miss gbp ++ ++ srcportmin=$(echo $srcport | cut
>             -d' ' -f1) ++ srcportmax=$(echo $srcport | cut -d' ' -f2)
>             + + proto_init_update "$link" 1 + +@@ -77,10 +80,18 @@
>             vxlan_generic_setup() { + + json_add_object 'data' + [ -n
>             "$port" ] && json_add_int port "$port" ++ [ -n
>             "$srcportmin" ] && json_add_int srcportmin "$srcportmin"
>             ++ [ -n "$srcportmax" ] && json_add_int srcportmax
>             "$srcportmax" + [ -n "$vid" ] && json_add_int id "$vid" +
>             [ -n "$macaddr" ] && json_add_string macaddr "$macaddr" +
>             [ -n "$rxcsum" ] && json_add_boolean rxcsum "$rxcsum" + [
>             -n "$txcsum" ] && json_add_boolean txcsum "$txcsum" ++ [
>             -n "$learning" ] && json_add_boolean learning "$learning"
>             ++ [ -n "$rsc" ] && json_add_boolean rsc "$rsc" ++ [ -n
>             "$proxy" ] && json_add_boolean proxy "$proxy" ++ [ -n
>             "$l2miss" ] && json_add_boolean l2miss "$l2miss" ++ [ -n
>             "$l3miss" ] && json_add_boolean l3miss "$l3miss" ++ [ -n
>             "$gbp" ] && json_add_boolean gbp "$gbp" +
>             json_close_object + + proto_close_tunnel +@@ -160,11
>             +171,18 @@ vxlan_generic_init_config() { + +
>             proto_config_add_int "vid" + proto_config_add_int "port"
>             ++ proto_config_add_string "srcport" +
>             proto_config_add_int "ttl" + proto_config_add_int "tos" +
>             proto_config_add_int "mtu" + proto_config_add_boolean
>             "rxcsum" + proto_config_add_boolean "txcsum" ++
>             proto_config_add_boolean "learning" ++
>             proto_config_add_boolean "rsc" ++ proto_config_add_boolean
>             "proxy" ++ proto_config_add_boolean "l2miss" ++
>             proto_config_add_boolean "l3miss" ++
>             proto_config_add_boolean "gbp" + proto_config_add_string
>             "macaddr" + } + +-- +2.28.0 + -- 2.28.0 
>
Adrian Schmutzler Aug. 3, 2020, 8:31 a.m.
> Wir muessen noch das naechste Batman update abwarten. Damit kann man gezielt Interfaces bevorzugen. Man wuerde einfach auf den Geraeten saemtliche Tunnel aufbauen und das Batman waehlt immer die schnellste Technologie, die gerade funktioniert. Ohne das Update wirds Zufall, oder man muss fastd abschalten um vxlan zu erzwingen, dann hat man aber keinen Fallback mehr.
> https://git.open-mesh.org/batman-adv.git/commit/921f23df8a26fa49f12f58dd8409f56e2b89e7d5

Das müsste man dann auch manuell einbauen, openwrt-routing backportet keine Features. Das wird ein bisschen Gefummel.

Grüße

Adrian
Johannes Kimmel Aug. 3, 2020, 5:47 p.m.
Hi,

On 03.08.20 10:31, mail@adrianschmutzler.de wrote:
>> Wir muessen noch das naechste Batman update abwarten. Damit kann man gezielt Interfaces bevorzugen. Man wuerde einfach auf den Geraeten saemtliche Tunnel aufbauen und das Batman waehlt immer die schnellste Technologie, die gerade funktioniert. Ohne das Update wirds Zufall, oder man muss fastd abschalten um vxlan zu erzwingen, dann hat man aber keinen Fallback mehr.
>> https://git.open-mesh.org/batman-adv.git/commit/921f23df8a26fa49f12f58dd8409f56e2b89e7d5
> 
> Das müsste man dann auch manuell einbauen, openwrt-routing backportet keine Features. Das wird ein bisschen Gefummel.

Wenn ich den Patch richtig verstehe, dann wird es auch reichen auf den 
Gateways eine neue Version zu fahren. Da haben wir also in der Hinsicht 
Glueck. Das ganze vxlan werden wir wohl ne Zeit lang Backporten muessen, 
wenn wir es wollen.

> 
> Grüße
> 
> Adrian
>
Robert Langhammer Oct. 20, 2020, 8:33 a.m.
Hi,

ich fasse mal kurz zusammen.

- Die Tunnel machen einen stabilen Eindruck und sind flott.

- Nur ein Interface pro Hood für alle Tunnel (wie bei fastd)

- Parallele Tunnel müssen wir vermeiden. Das erhöht das
batman-Grundrauschen überproportional. Dagegen wird wahrscheinlich auch
das Bevorzugen eines Interfaces in batman nicht helfen.
  Daraus folgt: nur ein Tunnel pro Gateway.

- Solange wir gemischte Hoods haben, also ein GW nur mit fastd und eins
mit vxlan, kommt es darauf an, wie sich babel für den Rückweg entscheidet.
fastd in so einem Fall ganz aus machen ist auch doof, da dann batman
irgendwie durch die Hood routet. Es sollten also alle GWs einer Hood
vxlan anbieten.

-> Man müsste also vpn-select etwas schlauer machen: Nur ein Tunnel pro
GW und welches Protokoll bevorzugt werden soll.

- Gefühlt ist der Zugang zur Hood etwas einfacher. Man braucht nur den
batman-Kram. Tunnel auf, batman drauf - drin.

- Wie das mit vxlan skaliert kann ich nicht wirklich sagen. Ich habe mal
ein paar hundert Tunnel mit batman drin aufgemacht. Funktioniert und
tut. Wie es sich dann allerdings mit "echten" Nodes verhält - ?

Viele Grüße
Robert


Am 03.08.20 um 19:47 schrieb Johannes Kimmel:
> Hi,
>
> On 03.08.20 10:31, mail@adrianschmutzler.de wrote:
>>> Wir muessen noch das naechste Batman update abwarten. Damit kann man
>>> gezielt Interfaces bevorzugen. Man wuerde einfach auf den Geraeten
>>> saemtliche Tunnel aufbauen und das Batman waehlt immer die
>>> schnellste Technologie, die gerade funktioniert. Ohne das Update
>>> wirds Zufall, oder man muss fastd abschalten um vxlan zu erzwingen,
>>> dann hat man aber keinen Fallback mehr.
>>> https://git.open-mesh.org/batman-adv.git/commit/921f23df8a26fa49f12f58dd8409f56e2b89e7d5
>>>
>>
>> Das müsste man dann auch manuell einbauen, openwrt-routing backportet
>> keine Features. Das wird ein bisschen Gefummel.
>
> Wenn ich den Patch richtig verstehe, dann wird es auch reichen auf den
> Gateways eine neue Version zu fahren. Da haben wir also in der
> Hinsicht Glueck. Das ganze vxlan werden wir wohl ne Zeit lang
> Backporten muessen, wenn wir es wollen.
>
>>
>> Grüße
>>
>> Adrian
>>