From f333c3c8221ec2cb01c9369bdbc8881ca8bc2937 Mon Sep 17 00:00:00 2001 From: Johannes Kimmel Date: Tue, 16 Feb 2021 08:09:32 +0100 Subject: [PATCH] fff-babeld: add MTU option to babelpeers Currently the MTU of a babelpeers is not configurable, nor set to a default value. If present, the `mtu` option is now copied to the interface section, otherwise it is set to a default value of 1500. Warning for VLAN Interfaces: For MTUs larger than 1500 to take effect, the parent interface also needs adjusting. E.g. setting `eth0.100` to an MTU larger than the MTU of `eth0` will not work. At this point, manually add the following section to `/etc/config/network`: ``` config interface option ifname 'eth0' option mtu '1570' ``` Beware that this will cause any child interface of `eth0` to have the same large MTU. Signed-off-by: Johannes Kimmel --- src/packages/fff/fff-babeld/Makefile | 2 +- src/packages/fff/fff-babeld/files/etc/layer3.d/40-babel | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/packages/fff/fff-babeld/Makefile b/src/packages/fff/fff-babeld/Makefile index fef1212..68b1d5a 100644 --- a/src/packages/fff/fff-babeld/Makefile +++ b/src/packages/fff/fff-babeld/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fff-babeld -PKG_RELEASE:=7 +PKG_RELEASE:=8 include $(INCLUDE_DIR)/package.mk diff --git a/src/packages/fff/fff-babeld/files/etc/layer3.d/40-babel b/src/packages/fff/fff-babeld/files/etc/layer3.d/40-babel index 1835d7d..9c99b22 100644 --- a/src/packages/fff/fff-babeld/files/etc/layer3.d/40-babel +++ b/src/packages/fff/fff-babeld/files/etc/layer3.d/40-babel @@ -35,6 +35,7 @@ configure() { local prefixname="babelpeer_$name" local vlan local type + local mtu # get iface if vlan=$(uci -q get gateway.$name.vlan); then @@ -52,10 +53,14 @@ configure() { # get rxcost rxcost=$(uci -q get gateway.$name.rxcost) || rxcost=96 + # get mtu + mtu=$(uci -q get gateway.$name.mtu) || mtu=1500 + # add interface uci set network.$prefixname=interface uci set network.$prefixname.proto=static uci set network.$prefixname.ifname=$iface + uci set network.$prefixname.mtu=$mtu # add iif-rules babel_add_iifrules "$prefixname" || { echo "Could not add iif-rules for babelpeer $name"; exit 1; }