Compare commits

...

9 Commits
master ... dsa2

28 changed files with 147 additions and 881 deletions

5
bsp/octeon.bsp Normal file
View File

@ -0,0 +1,5 @@
chipset=octeon
images=(
"openwrt-${chipset}-ubnt_edgerouter-4-*"
)

21
bsp/octeon/.config Normal file
View File

@ -0,0 +1,21 @@
# Generated using "./buildscript config openwrt".
# Do no edit manually
#
CONFIG_TARGET_octeon=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
CONFIG_TARGET_DEVICE_octeon_DEVICE_ubnt_edgerouter-4=y
CONFIG_TARGET_DEVICE_PACKAGES_octeon_DEVICE_ubnt_edgerouter-4=""
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
# CONFIG_BUSYBOX_CONFIG_BRCTL is not set
# CONFIG_BUSYBOX_CONFIG_CROND is not set
# CONFIG_BUSYBOX_CONFIG_CRONTAB is not set
# CONFIG_BUSYBOX_CONFIG_FEATURE_FAST_TOP is not set
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
CONFIG_CLEAN_IPKG=y
# CONFIG_DROPBEAR_CURVE25519 is not set
# CONFIG_PACKAGE_ALFRED_VIS is not set
CONFIG_PACKAGE_opkg=m
CONFIG_STRIP_KERNEL_EXPORTS=y
CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=512

View File

@ -2,7 +2,7 @@ chipset=ramips
subtarget=mt7621
images=(
"openwrt-ramips-mt7621-r6220-squashfs-*"
"openwrt-ramips-mt7621-ubnt-erx-squashfs-*"
"openwrt-ramips-mt7621-ubnt-erx-sfp-squashfs-*"
"openwrt-ramips-mt7621-netgear_r6220-squashfs-*"
"openwrt-ramips-mt7621-ubnt_edgerouter-x-squashfs-*"
"openwrt-ramips-mt7621-ubnt_edgerouter-x-sfp-squashfs-*"
)

View File

@ -4,12 +4,12 @@
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7621=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_r6220=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt7621_DEVICE_r6220=""
CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ubnt-erx=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt7621_DEVICE_ubnt-erx=""
CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ubnt-erx-sfp=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt7621_DEVICE_ubnt-erx-sfp=""
CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r6220=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt7621_DEVICE_netgear_r6220=""
CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ubnt_edgerouter-x=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt7621_DEVICE_ubnt_edgerouter-x=""
CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ubnt_edgerouter-x-sfp=y
CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt7621_DEVICE_ubnt_edgerouter-x-sfp=""
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
# CONFIG_BUSYBOX_CONFIG_BRCTL is not set
@ -19,13 +19,6 @@ CONFIG_TARGET_PER_DEVICE_ROOTFS=y
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
CONFIG_CLEAN_IPKG=y
# CONFIG_DROPBEAR_CURVE25519 is not set
# CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 is not set
# CONFIG_FASTD_ENABLE_MAC_GHASH is not set
# CONFIG_FASTD_ENABLE_MAC_UHASH is not set
# CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC is not set
# CONFIG_FASTD_ENABLE_METHOD_COMPOSED_UMAC is not set
# CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC is not set
# CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC is not set
# CONFIG_PACKAGE_ALFRED_VIS is not set
CONFIG_PACKAGE_opkg=m
CONFIG_STRIP_KERNEL_EXPORTS=y

View File

@ -6,18 +6,23 @@ This disables all OpenWrt config migration mechanisms except for
files listed in /etc/sysupgrade.conf
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 6c518b780eddd973966537b50d8f7c82539bb1e1..49d4514b988e827098450d57da0ae50a37506d3a 100755
index 7977b06ef1..df60f21b2f 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -134,9 +134,9 @@ list_changed_conffiles() {
add_conffiles() {
local file="$1"
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
@@ -135,14 +135,14 @@ list_static_conffiles() {
local filter=$1
find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
- /etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
+ /etc/sysupgrade.conf 2>/dev/null) \
\( -type f -o -type l \) $find_filter 2>/dev/null;
- list_changed_conffiles ) | sort -u > "$file"
+ ) | sort -u > "$file"
return 0
\( -type f -o -type l \) $filter 2>/dev/null
}
add_conffiles() {
local file="$1"
- ( list_static_conffiles "$find_filter"; list_changed_conffiles ) |
+ ( list_static_conffiles "$find_filter" ) |
sort -u > "$file"
return 0
}

View File

@ -3,7 +3,7 @@ Date: Sat, 8 Jul 2017 10:47:28 +0200
Subject: set root password
diff --git a/package/base-files/files/etc/shadow b/package/base-files/files/etc/shadow
index 4b4154f21f478cc025a350363b3e34319c6afacc..b8d180a95691ab09f9c4d759ffd97da34a022623 100644
index 4b4154f21f..b8d180a956 100644
--- a/package/base-files/files/etc/shadow
+++ b/package/base-files/files/etc/shadow
@@ -1,4 +1,4 @@

View File

@ -3,7 +3,7 @@ Date: Sat, 8 Jul 2017 10:47:56 +0200
Subject: ntpd host as string
diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd
index 52866ba32acd26a490f9c9024fc3e43e0f757496..b6b28cd02527b89c0a4cc2f9adef52bb4c8427b0 100755
index 19571a2306..c58febfbfe 100755
--- a/package/utils/busybox/files/sysntpd
+++ b/package/utils/busybox/files/sysntpd
@@ -30,7 +30,7 @@ get_dhcp_ntp_servers() {

View File

@ -1,43 +0,0 @@
From: Johannes Kimmel <fff@bareminimum.eu>
Date: Mon, 20 Jul 2020 08:05:09 +0200
Subject: vxlan: remove mandatory peeraddr
vxlan can be configured without a peer address. This is used to prepare
an interface and add peers later.
Fixes: FS#2743
Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Acked-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 5222aadbf353b7cc030c39aa816f33951b104552)
diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh
index 7b1c7039551b7781f5f7a8e73b964db698f3697b..bdcaa628c4416cc83258dd38a6fc0978ea55a3bb 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -55,12 +55,6 @@ proto_vxlan_setup() {
local ipaddr peeraddr
json_get_vars ipaddr peeraddr tunlink
- [ -z "$peeraddr" ] && {
- proto_notify_error "$cfg" "MISSING_ADDRESS"
- proto_block_restart "$cfg"
- exit
- }
-
( proto_add_host_dependency "$cfg" '' "$tunlink" )
[ -z "$ipaddr" ] && {
@@ -85,12 +79,6 @@ proto_vxlan6_setup() {
local ip6addr peer6addr
json_get_vars ip6addr peer6addr tunlink
- [ -z "$peer6addr" ] && {
- proto_notify_error "$cfg" "MISSING_ADDRESS"
- proto_block_restart "$cfg"
- exit
- }
-
( proto_add_host_dependency "$cfg" '' "$tunlink" )
[ -z "$ip6addr" ] && {

View File

@ -1,159 +0,0 @@
From: Johannes Kimmel <fff@bareminimum.eu>
Date: Mon, 20 Jul 2020 08:05:10 +0200
Subject: vxlan: add capability for multiple fdb entries
Similar to wireguard, vxlan can configure multiple peers or add specific
entries to the fdb for a single mac address.
While you can still use peeraddr/peer6addr option within the proto
vxlan/vxlan6 section to not break existing configurations, this patch
allows to add multiple sections that conigure fdb entries via the bridge
command. As such, the bridge command is now a dependency of the vxlan
package. (To be honest without the bridge command available, vxlan isn't
very much fun to use or debug at all)
Field names are taken direclty from the bridge command.
Example with all supported parameters, since this hasn't been documented so
far:
config interface 'vx0'
option proto 'vxlan6' # use vxlan over ipv6
# main options
option ip6addr '2001:db8::1' # listen address
option tunlink 'wan6' # optional if listen address given
option peer6addr '2001:db8::2' # now optional
option port '8472' # this is the standard port under linux
option vid '42' # VXLAN Network Identifier to use
option mtu '1430' # vxlan6 has 70 bytes overhead
# extra options
option rxcsum '0' # allow receiving packets without checksum
option txcsum '0' # send packets without checksum
option ttl '16' # specifies the TTL value for outgoing packets
option tos '0' # specifies the TOS value for outgoing packets
option macaddr '11:22:33:44:55:66' # optional, manually specify mac
# default is a random address
Single peer with head-end replication. Corresponds to the following call
to bridge:
$ bridge fdb append 00:00:00:00:00:00 dev vx0 dst 2001:db8::3
config vxlan_peer
option vxlan 'vx0'
option dst '2001:db8::3' # always required
For multiple peers, this section can be repeated for each dst address.
It's possible to specify a multicast address as destination. Useful when
multicast routing is available or within one lan segment:
config vxlan_peer
option vxlan 'vx0'
option dst 'ff02::1337' # multicast group to join.
# all bum traffic will be send there
option via 'eth1' # for multicast, an outgoing interface needs
# to be specified
All available peer options for completeness:
config vxlan_peer
option vxlan 'vx0' # the interface to configure
option lladdr 'aa:bb:cc:dd:ee:ff' # specific mac,
option dst '2001:db8::4' # connected to this peer
option via 'eth0.1' # use this interface only
option port '4789' # use different port for this peer
option vni '23' # override vni for this peer
option src_vni '123' # see man 3 bridge
Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
(cherry picked from commit 65e9de3c333bae1ccef1dfb0cc008ad6f13958e4)
diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile
index 13fcf0c55d07d97f5dcc3cbfcf2478020e7107cc..7232f71b45e6f72f2c62a245ad44cb9ade144f52 100644
--- a/package/network/config/vxlan/Makefile
+++ b/package/network/config/vxlan/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vxlan
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh
index bdcaa628c4416cc83258dd38a6fc0978ea55a3bb..d063c47d47d0f4e339b21e97f4e25f55a33c0497 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -7,6 +7,50 @@
init_proto "$@"
}
+proto_vxlan_setup_peer() {
+ type bridge &> /dev/null || {
+ proto_notify_error "$cfg" "MISSING_BRIDGE_COMMAND"
+ exit
+ }
+
+ local peer_config="$1"
+
+ local vxlan
+ local lladdr
+ local dst
+ local src_vni
+ local vni
+ local port
+ local via
+
+ config_get vxlan "${peer_config}" "vxlan"
+ config_get lladdr "${peer_config}" "lladdr"
+ config_get dst "${peer_config}" "dst"
+ config_get src_vni "${peer_config}" "src_vni"
+ config_get vni "${peer_config}" "vni"
+ config_get port "${peer_config}" "port"
+ config_get via "${peer_config}" "via"
+
+ [ "$cfg" = "$vxlan" ] || {
+ # This peer section belongs to another device
+ return
+ }
+
+ [ -n "${dst}" ] || {
+ proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
+ exit
+ }
+
+ bridge fdb append \
+ ${lladdr:-00:00:00:00:00:00} \
+ dev ${cfg} \
+ dst ${dst} \
+ ${src_vni:+src_vni $src_vni} \
+ ${vni:+vni $vni} \
+ ${port:+port $port} \
+ ${via:+via $via}
+}
+
vxlan_generic_setup() {
local cfg="$1"
local mode="$2"
@@ -18,7 +62,6 @@ vxlan_generic_setup() {
local port vid ttl tos mtu macaddr zone rxcsum txcsum
json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum
-
proto_init_update "$link" 1
proto_add_tunnel
@@ -47,6 +90,9 @@ vxlan_generic_setup() {
proto_close_data
proto_send_update "$cfg"
+
+ config_load network
+ config_foreach proto_vxlan_setup_peer "vxlan_peer"
}
proto_vxlan_setup() {

View File

@ -1,90 +0,0 @@
From: Hans Dedecker <dedeckeh@gmail.com>
Date: Mon, 14 Sep 2020 21:55:01 +0200
Subject: vxlan: add extra config options
Add config options:
srcportmin/srcportmax : range of port numbers to use as UDP source ports
to communicate to the remote VXLAN tunnel endpoint
ageing : lifetime in seconds of FDB entries learnt by the kernel
maxaddress : maximum number of FDB entries
learning : enable/disable entering unknown source link layer addresses
and IP addresses into the VXLAN device FDB.
rsc : enable/disable route short circuit
proxy : enable/disable ARP proxy
l2miss : enable/disable netlink LLADDR miss notifications
l3miss : enable/disable netlink IP ADDR miss notifications
gbp : enable/disable the Group Policy extension
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 036221ce5a899eb99ef1c1623fc9460af00a69e7)
diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile
index 7232f71b45e6f72f2c62a245ad44cb9ade144f52..eb053bf1118dd300db549906bfd474a19f5e3752 100644
--- a/package/network/config/vxlan/Makefile
+++ b/package/network/config/vxlan/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vxlan
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh
index d063c47d47d0f4e339b21e97f4e25f55a33c0497..8b3a0a53d47c675fcf89981061a250b5f526df3e 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -59,8 +59,8 @@ 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 vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp
+ json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp
proto_init_update "$link" 1
@@ -78,9 +78,20 @@ vxlan_generic_setup() {
json_add_object 'data'
[ -n "$port" ] && json_add_int port "$port"
[ -n "$vid" ] && json_add_int id "$vid"
+ [ -n "$srcportmin" ] && json_add_int srcportmin "$srcportmin"
+ [ -n "$srcportmax" ] && json_add_int srcportmax "$srcportmax"
+ [ -n "$ageing" ] && json_add_int ageing "$ageing"
+ [ -n "$maxaddress" ] && json_add_int maxaddress "$maxaddress"
[ -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
@@ -163,9 +174,20 @@ vxlan_generic_init_config() {
proto_config_add_int "ttl"
proto_config_add_int "tos"
proto_config_add_int "mtu"
+ proto_config_add_int "srcportmin"
+ proto_config_add_int "srcportmax"
+ proto_config_add_int "ageing"
+ proto_config_add_int "maxaddress"
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"
+
}
proto_vxlan_init_config() {

View File

@ -1,37 +0,0 @@
From: Hans Dedecker <dedeckeh@gmail.com>
Date: Thu, 24 Sep 2020 22:04:39 +0200
Subject: vxlan: fix rsc config option
Fix route short circuit config option; fixes commit 036221ce5a899eb99ef1c1623fc9460af00a69e7
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit ad3044c424510668dd318c6a48c0b56bfba3c2da)
diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile
index eb053bf1118dd300db549906bfd474a19f5e3752..0b4d6713f9e1cfcad9f4c94272f8dc9192b7f3b4 100644
--- a/package/network/config/vxlan/Makefile
+++ b/package/network/config/vxlan/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vxlan
-PKG_RELEASE:=5
+PKG_RELEASE:=6
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh
index 8b3a0a53d47c675fcf89981061a250b5f526df3e..5c1c484c47f7fb48f1cb705b200d589df77a60f6 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -59,8 +59,8 @@ vxlan_generic_setup() {
local link="$cfg"
- local port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp
- json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning proxy l2miss l3miss gbp
+ local port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning rsc proxy l2miss l3miss gbp
+ json_get_vars port vid ttl tos mtu macaddr zone rxcsum txcsum srcportmin srcportmax ageing maxaddress learning rsc proxy l2miss l3miss gbp
proto_init_update "$link" 1

View File

@ -1,101 +0,0 @@
From: Johannes Kimmel <fff@bareminimum.eu>
Date: Tue, 15 Dec 2020 00:31:52 +0100
Subject: vxlan: allow for dynamic source ip selection (FS#3426)
By setting 'auto', the zero address or the empty string as source
address (option ipaddr, option ip6addr), vxlan will choose one
dynamically. This helps in setups where a wan ip or prefix changes.
This corresponse to setting up an vxlan tunnel with:
proto vxlan6:
# ip link add vx0 type vxlan id ID local :: ...
proto vxlan:
# ip link add vx0 type vxlan id ID local 0.0.0.0 ...
While it is possible to not specify a source ip at all, the kernel will
default to setting up a ipv4 tunnel. The kernel will take any hint from
source and peer ips to figure out, what tunnel type to use. To make sure
we setup an ipv6 tunnel for proto vxlan6, this workaround is needed.
This will not change the behaviour of currently working configurations.
However this will allow former broken configurations, namely those not
specifying both a source address and tunnel interface, to setup a
tunnel interface. Previously those configurations weren't reporting an
error and were stueck in a setup loop like in Bug FS#3426.
This change lifts the currently very strict behaviour and should fix the
following bug:
Fixes: FS#3426
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3426
Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
(cherry picked from commit 3f5619f259de42af4404e0e36d11df4adcef9f5e)
diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile
index 0b4d6713f9e1cfcad9f4c94272f8dc9192b7f3b4..97972d6d85bddc56d1575088d3966ae6899f06da 100644
--- a/package/network/config/vxlan/Makefile
+++ b/package/network/config/vxlan/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vxlan
-PKG_RELEASE:=6
+PKG_RELEASE:=7
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh
index 5c1c484c47f7fb48f1cb705b200d589df77a60f6..a087c4a3ce2ca42a6b8d43b2254d0ea7379c0936 100755
--- a/package/network/config/vxlan/files/vxlan.sh
+++ b/package/network/config/vxlan/files/vxlan.sh
@@ -114,18 +114,11 @@ proto_vxlan_setup() {
( proto_add_host_dependency "$cfg" '' "$tunlink" )
- [ -z "$ipaddr" ] && {
- local wanif="$tunlink"
- if [ -z "$wanif" ] && ! network_find_wan wanif; then
- proto_notify_error "$cfg" "NO_WAN_LINK"
- exit
- fi
-
- if ! network_get_ipaddr ipaddr "$wanif"; then
- proto_notify_error "$cfg" "NO_WAN_LINK"
- exit
- fi
- }
+ case "$ipaddr" in
+ "auto"|"")
+ ipaddr="0.0.0.0"
+ ;;
+ esac
vxlan_generic_setup "$cfg" 'vxlan' "$ipaddr" "$peeraddr"
}
@@ -138,18 +131,12 @@ proto_vxlan6_setup() {
( proto_add_host_dependency "$cfg" '' "$tunlink" )
- [ -z "$ip6addr" ] && {
- local wanif="$tunlink"
- if [ -z "$wanif" ] && ! network_find_wan6 wanif; then
- proto_notify_error "$cfg" "NO_WAN_LINK"
- exit
- fi
-
- if ! network_get_ipaddr6 ip6addr "$wanif"; then
- proto_notify_error "$cfg" "NO_WAN_LINK"
- exit
- fi
- }
+ case "$ip6addr" in
+ "auto"|"")
+ # ensure tunnel via ipv6
+ ip6addr="::"
+ ;;
+ esac
vxlan_generic_setup "$cfg" 'vxlan6' "$ip6addr" "$peer6addr"
}

View File

@ -1,324 +0,0 @@
From: Johannes Kimmel <fff@bareminimum.eu>
Date: Fri, 1 Jan 2021 09:55:25 +0100
Subject: netifd: backport vxlan patches
Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
[refresh patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
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 0000000000000000000000000000000000000000..0b803aca8bebe33ad47f7e441bc9aa36d42b0aea
--- /dev/null
+++ b/package/network/config/netifd/patches/0001-netifd-vxlan-handle-srcport-range.patch
@@ -0,0 +1,89 @@
+From a3c033e2afc289672e0ed4b8d8a835d509715af8 Mon Sep 17 00:00:00 2001
+From: Johannes Kimmel <fff@bareminimum.eu>
+Date: Fri, 4 Sep 2020 04:59:40 +0200
+Subject: [PATCH 1/4] 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(+)
+
+--- a/system-linux.c
++++ b/system-linux.c
+@@ -3062,6 +3062,32 @@ static int system_add_vxlan(const char *
+ }
+ 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);
+--- a/system.c
++++ b/system.c
+@@ -38,6 +38,8 @@ static const struct blobmsg_policy vxlan
+ [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 = {
+--- a/system.h
++++ b/system.h
+@@ -43,6 +43,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
+ };
+
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 0000000000000000000000000000000000000000..3c60665354a52159566826bbedf59964077205d5
--- /dev/null
+++ b/package/network/config/netifd/patches/0002-netifd-vxlan-refactor-mapping-of-boolean-attrs.patch
@@ -0,0 +1,54 @@
+From 226566b967dc4ef4d83ed7844b8ad746f4306f8d Mon Sep 17 00:00:00 2001
+From: Johannes Kimmel <fff@bareminimum.eu>
+Date: Fri, 4 Sep 2020 04:59:41 +0200
+Subject: [PATCH 2/4] 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(-)
+
+--- a/system-linux.c
++++ b/system-linux.c
+@@ -2951,6 +2951,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];
+@@ -3088,16 +3099,9 @@ static int system_add_vxlan(const char *
+ 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_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
++ 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_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM, true);
+
+ if ((cur = tb[TUNNEL_ATTR_TOS])) {
+ char *str = blobmsg_get_string(cur);
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 0000000000000000000000000000000000000000..693e92b9f6b50f20d8fd220c196440d7bf894eb9
--- /dev/null
+++ b/package/network/config/netifd/patches/0003-netifd-vxlan-add-most-missing-boolean-options.patch
@@ -0,0 +1,93 @@
+From 11223f5550f7dd8faefb85441065b682be16e61f Mon Sep 17 00:00:00 2001
+From: Johannes Kimmel <fff@bareminimum.eu>
+Date: Fri, 4 Sep 2020 04:59:42 +0200
+Subject: [PATCH 3/4] 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 | 16 +++++++++++++---
+ system.c | 6 ++++++
+ system.h | 6 ++++++
+ 3 files changed, 25 insertions(+), 3 deletions(-)
+
+--- a/system-linux.c
++++ b/system-linux.c
+@@ -2955,10 +2955,14 @@ static void system_vxlan_map_bool_attr(s
+ struct blob_attr *cur;
+ if ((cur = tb_data[vxlandatatype])) {
+ bool val = blobmsg_get_bool(cur);
+- if (invert) {
++ if (invert)
+ val = !val;
+- }
+- nla_put_u8(msg, attrtype, val);
++
++ if ((attrtype == IFLA_VXLAN_GBP) && val)
++ nla_put_flag(msg, attrtype);
++ else
++ nla_put_u8(msg, attrtype, val);
++
+ }
+ }
+
+@@ -3102,6 +3106,12 @@ static int system_add_vxlan(const char *
+ 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_RX, VXLAN_DATA_ATTR_RXCSUM, true);
+ 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);
+--- a/system.c
++++ b/system.c
+@@ -40,6 +40,12 @@ static const struct blobmsg_policy vxlan
+ [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 = {
+--- a/system.h
++++ b/system.h
+@@ -45,6 +45,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
+ };
+
diff --git a/package/network/config/netifd/patches/0004-netifd-vxlan-add-aging-and-maxaddress-options.patch b/package/network/config/netifd/patches/0004-netifd-vxlan-add-aging-and-maxaddress-options.patch
new file mode 100644
index 0000000000000000000000000000000000000000..8a2b4424fe282492ecf64522ecf3d1b3ba106bbb
--- /dev/null
+++ b/package/network/config/netifd/patches/0004-netifd-vxlan-add-aging-and-maxaddress-options.patch
@@ -0,0 +1,56 @@
+From 55a7b6b7f2f773c06a79cb7359ffdab54ba32450 Mon Sep 17 00:00:00 2001
+From: Johannes Kimmel <fff@bareminimum.eu>
+Date: Fri, 4 Sep 2020 04:59:43 +0200
+Subject: [PATCH 4/4] netifd: vxlan: add aging and maxaddress options
+
+For both options the values can just be passed to the kernel. All
+unsigned values are accepted, thus no range checking required.
+
+Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
+---
+ system-linux.c | 10 ++++++++++
+ system.c | 2 ++
+ system.h | 2 ++
+ 3 files changed, 14 insertions(+)
+
+--- a/system-linux.c
++++ b/system-linux.c
+@@ -3113,6 +3113,16 @@ static int system_add_vxlan(const char *
+ 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_data[VXLAN_DATA_ATTR_AGEING])) {
++ uint32_t ageing = blobmsg_get_u32(cur);
++ nla_put_u32(msg, IFLA_VXLAN_AGEING, ageing);
++ }
++
++ if ((cur = tb_data[VXLAN_DATA_ATTR_LIMIT])) {
++ uint32_t maxaddress = blobmsg_get_u32(cur);
++ nla_put_u32(msg, IFLA_VXLAN_LIMIT, maxaddress);
++ }
++
+ if ((cur = tb[TUNNEL_ATTR_TOS])) {
+ char *str = blobmsg_get_string(cur);
+ unsigned tos = 1;
+--- a/system.c
++++ b/system.c
+@@ -46,6 +46,8 @@ static const struct blobmsg_policy vxlan
+ [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 },
++ [VXLAN_DATA_ATTR_AGEING] = { .name = "ageing", .type = BLOBMSG_TYPE_INT32 },
++ [VXLAN_DATA_ATTR_LIMIT] = { .name = "maxaddress", .type = BLOBMSG_TYPE_INT32 },
+ };
+
+ const struct uci_blob_param_list vxlan_data_attr_list = {
+--- a/system.h
++++ b/system.h
+@@ -51,6 +51,8 @@ enum vxlan_data {
+ VXLAN_DATA_ATTR_L2MISS,
+ VXLAN_DATA_ATTR_L3MISS,
+ VXLAN_DATA_ATTR_GBP,
++ VXLAN_DATA_ATTR_AGEING,
++ VXLAN_DATA_ATTR_LIMIT,
+ __VXLAN_DATA_ATTR_MAX
+ };
+

View File

@ -3,10 +3,10 @@
builddir=./build
# OpenWrt: package hashes correspond to core repo version
OPENWRTREV="v19.07.7"
PACKAGEREV="90af10d01579425369bd474051b6d3ddaf32a7e3"
ROUTINGREV="e26b4745209655976b7d124465b1dc53ade632f9"
# OpenWrt: openwrt-19.07.5
OPENWRTREV="8b3d879861086fbb965f5bdb95e1286ec049c290"
PACKAGEREV="1831941e7383cae1abb9d371e3dfb3b47a6c214e"
ROUTINGREV="6f29856e60bcdda9c93c3228625257dfceb4a411"
# Gluon packages: master from 2020-02-04
GLUONREV="12e41d0ff07ec54bbd67a31ab50d12ca04f2238c"

View File

@ -1,44 +0,0 @@
From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Date: Wed, 22 Apr 2020 16:57:34 +0200
Subject: micrond: show stdout and stderr in log
So far, all output created by scripts run with micrond has been
discarded. Since there is no reason for that and it also does not
match the expected behavior, this enables both stdout and stderr
output for the service.
If not desired, a user can still use >/dev/null or similar in his/her
micrond jobs to disable output easily and similar to what it would be
on other systems.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
---
utils/micrond/Makefile | 2 +-
utils/micrond/files/etc/init.d/micrond | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/utils/micrond/Makefile b/utils/micrond/Makefile
index ba063b674..c979025bb 100644
--- a/utils/micrond/Makefile
+++ b/utils/micrond/Makefile
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=micrond
PKG_VERSION:=1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_LICENSE:=BSD-2-clause
include $(INCLUDE_DIR)/package.mk
diff --git a/utils/micrond/files/etc/init.d/micrond b/utils/micrond/files/etc/init.d/micrond
index 1eef2ef52..35a3b9e70 100755
--- a/utils/micrond/files/etc/init.d/micrond
+++ b/utils/micrond/files/etc/init.d/micrond
@@ -9,5 +9,7 @@ start_service() {
procd_open_instance
procd_set_param command /usr/sbin/micrond "$CRONDIR"
procd_set_param respawn
+ procd_set_param stdout 1
+ procd_set_param stderr 1
procd_close_instance
}

View File

@ -1,7 +1,7 @@
From f114914490740247f2b6ca705f0f7055db9681ab Mon Sep 17 00:00:00 2001
From af52d8a526d8aa99db937cd3ca86d49814bc4190 Mon Sep 17 00:00:00 2001
From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Date: Mon, 30 Sep 2019 17:09:10 +0200
Subject: [PATCH 1/2] babeld: Include PKG_RELEASE in babeld version
Subject: [PATCH] babeld: Include PKG_RELEASE in babeld version
This will account for custom patches added, as otherwise version
would stay the same.
@ -14,12 +14,12 @@ Signed-off-by: Fabian Bläse <fabian@blaese.de>
1 file changed, 5 insertions(+)
diff --git a/babeld/Makefile b/babeld/Makefile
index 022d0b8..78fdf83 100644
index 0b61128..b0ed749 100644
--- a/babeld/Makefile
+++ b/babeld/Makefile
@@ -48,6 +48,11 @@ MAKE_FLAGS+= \
CFLAGS="$(TARGET_CFLAGS)" \
@@ -49,6 +49,11 @@ MAKE_FLAGS+= \
LDLIBS="" \
LDLIBS+="-lubus -lubox"
+define Build/Configure
+ echo "babeld-$(PKG_VERSION)+fff$(PKG_RELEASE)" > $(PKG_BUILD_DIR)/version
@ -30,5 +30,5 @@ index 022d0b8..78fdf83 100644
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/
--
2.25.1
2.30.1

View File

@ -13,7 +13,12 @@ configure() {
local ports="$(uci -q get gateway.$vlan.ports)"
local name="$SWITCHDEV"_$vlan
uci set network.$name='switch_vlan'
if [ "$DSA" = "1" ]; then
uci set network.$name='bridge-vlan'
else
uci set network.$name='switch_vlan'
fi
uci set network.$name.device="$(uci get network.$SWITCHDEV.name)"
uci set network.$name.vlan="$vlan"
uci set network.$name.ports="$(get_cpu_port) $ports"
@ -34,6 +39,7 @@ configure() {
config_load network
config_foreach remove_vlan switch_vlan
config_foreach remove_vlan bridge-vlan
config_load gateway
config_foreach add_vlan vlan

View File

@ -50,7 +50,7 @@ configure() {
# set interface
#remove all eth interfaces
ifaces=$(uci get network.client.ifname | sed 's/\beth[^ ]* *//g')
ifaces=$(uci get network.client.ifname | sed 's/\beth[^ ]* *//g' | sed 's/\bswitch[^ ]* *//g')
if vlan=$(uci -q get gateway.@client[0].vlan); then
uci set network.client.ifname="${SWITCHDEV}.$vlan $ifaces"
elif iface=$(uci -q get gateway.@client[0].iface); then

View File

@ -11,12 +11,10 @@ get_cpu_port() {
tplink,c50-v4|\
tplink,tl-wr1043nd-v2|\
tplink,tl-wr1043nd-v3|\
tl-wr841n-v13|\
r6220|\
ubnt-erx|\
ubnt-erx-sfp)
tl-wr841n-v13)
CPUPORT="6t"
;;
netgear,r6220|\
tplink,cpe210-v2|\
tplink,cpe210-v3|\
tplink,tl-mr3020-v1|\
@ -24,6 +22,8 @@ get_cpu_port() {
tplink,tl-wa860re-v1|\
tplink,tl-wa901nd-v2|\
ubnt,bullet-m|\
ubnt,edgerouter-x|\
ubnt,edgerouter-x-sfp|\
ubnt,nanostation-loco-m|\
ubnt,nanostation-loco-m-xw|\
ubnt,nanostation-m|\

View File

@ -65,31 +65,52 @@ fi
if ! uci -q get network.$SWITCHDEV > /dev/null || [ "$FORCEPARSE" = '1' ] ; then
SWITCHHW=$(swconfig list | awk '{ print $4 }')
if [ "$DSA" = "1" ]; then
uci set network.$SWITCHDEV=device
uci set network.$SWITCHDEV.name=$SWITCHDEV
uci set network.$SWITCHDEV.type=bridge
uci set network.$SWITCHDEV=switch
uci set network.$SWITCHDEV.name=$SWITCHHW
uci set network.$SWITCHDEV.enable=1
uci set network.$SWITCHDEV.reset=1
uci set network.$SWITCHDEV.enable_vlan=1
uci set network.${SWITCHDEV}_1=bridge-vlan
uci set network.${SWITCHDEV}_1.device=$SWITCHDEV
uci set network.${SWITCHDEV}_1.vlan=1
uci set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
uci set network.${SWITCHDEV}_1=switch_vlan
uci set network.${SWITCHDEV}_1.device=$SWITCHHW
uci set network.${SWITCHDEV}_1.vlan=1
uci set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
if [ "$WANDEV" = "$SWITCHDEV" ] || ! [ -z "$WAN_PORTS" ]; then
uci set network.${SWITCHDEV}_2=bridge-vlan
uci set network.${SWITCHDEV}_2.device=$SWITCHDEV
uci set network.${SWITCHDEV}_2.vlan=2
uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
fi
if [ "$WANDEV" = "$SWITCHDEV" ] || ! [ -z "$WAN_PORTS" ]; then
uci set network.${SWITCHDEV}_2=switch_vlan
uci set network.${SWITCHDEV}_2.device=$SWITCHHW
uci set network.${SWITCHDEV}_2.vlan=2
uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
uci set network.${SWITCHDEV}_3=bridge-vlan
uci set network.${SWITCHDEV}_3.device=$SWITCHDEV
uci set network.${SWITCHDEV}_3.vlan=3
uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
else
uci set network.$SWITCHDEV=switch
uci set network.$SWITCHDEV.name=$SWITCHHW
uci set network.$SWITCHDEV.enable=1
uci set network.$SWITCHDEV.reset=1
uci set network.$SWITCHDEV.enable_vlan=1
uci set network.${SWITCHDEV}_1=switch_vlan
uci set network.${SWITCHDEV}_1.device=$SWITCHHW
uci set network.${SWITCHDEV}_1.vlan=1
uci set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
if [ "$WANDEV" = "$SWITCHDEV" ] || ! [ -z "$WAN_PORTS" ]; then
uci set network.${SWITCHDEV}_2=switch_vlan
uci set network.${SWITCHDEV}_2.device=$SWITCHHW
uci set network.${SWITCHDEV}_2.vlan=2
uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
fi
uci set network.${SWITCHDEV}_3=switch_vlan
uci set network.${SWITCHDEV}_3.device=$SWITCHHW
uci set network.${SWITCHDEV}_3.vlan=3
uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
fi
uci set network.${SWITCHDEV}_3=switch_vlan
uci set network.${SWITCHDEV}_3.device=$SWITCHHW
uci set network.${SWITCHDEV}_3.vlan=3
uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"
uci set network.client.ifname="$SWITCHDEV.1 bat0"
uci set network.ethmesh.ifname="$SWITCHDEV.3"

View File

@ -0,0 +1,10 @@
. /lib/functions/fff/network
WANDEV=switch0
SWITCHDEV=switch0
CLIENT_PORTS="lan2"
WAN_PORTS="lan0"
BATMAN_PORTS="lan1"
DSA=1
ROUTERMAC=$(cat /sys/class/net/lan3/address)

View File

@ -0,0 +1,10 @@
. /lib/functions/fff/network
WANDEV=switch0
SWITCHDEV=switch0
CLIENT_PORTS="eth3 eth4"
WAN_PORTS="eth0"
BATMAN_PORTS="eth1 eth2"
DSA=1
ROUTERMAC=$(cat /sys/class/net/eth0/address)

View File

@ -0,0 +1,10 @@
. /lib/functions/fff/network
WANDEV=switch0
SWITCHDEV=switch0
CLIENT_PORTS="eth3 eth4 eth5"
WAN_PORTS="eth0"
BATMAN_PORTS="eth1 eth2"
DSA=1
ROUTERMAC=$(cat /sys/class/net/eth0/address)

View File

@ -1,9 +0,0 @@
. /lib/functions/fff/network
WANDEV=eth0
SWITCHDEV=eth0
CLIENT_PORTS="6t 3 4"
WAN_PORTS="6t 0"
BATMAN_PORTS="6t 1 2"
ROUTERMAC=$(cat /sys/class/net/eth0/address)

View File

@ -1,9 +0,0 @@
. /lib/functions/fff/network
WANDEV=eth0
SWITCHDEV=eth0
CLIENT_PORTS="6t 3 4"
WAN_PORTS="6t 0"
BATMAN_PORTS="6t 1 2"
ROUTERMAC=$(cat /sys/class/net/eth0/address)

View File

@ -10,7 +10,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Freifunk
TITLE:=Freifunk-Franken Webinterface
URL:=http://www.freifunk-franken.de
DEPENDS:=+uhttpd +libustream-mbedtls +haserl +px5g +fff-simple-tc \
DEPENDS:=+uhttpd +libustream-wolfssl +haserl +px5g +fff-simple-tc \
+fff-boardname +fff-config +fff-network +fff-hoodutils \
+@BUSYBOX_CONFIG_WGET +@BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT
endef

View File

@ -12,7 +12,8 @@ define Package/fff-wireguard
URL:=https://www.freifunk-franken.de
DEPENDS:= \
+owipcalc \
+wireguard \
+kmod-wireguard \
+wireguard-tools \
+fff-babeld \
+fff-network
endef