From 3876228a38a71966ad2e925676a7d09ba002b1aa Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 15 Sep 2022 19:19:54 +0200 Subject: [PATCH] pkgs/openwrt/uci-config: add mtu hotfix --- nix/pkgs/openwrt/uci-config.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nix/pkgs/openwrt/uci-config.nix b/nix/pkgs/openwrt/uci-config.nix index c5f2eb5..5098be6 100644 --- a/nix/pkgs/openwrt/uci-config.nix +++ b/nix/pkgs/openwrt/uci-config.nix @@ -294,6 +294,20 @@ in uci commit + # Add hotfixes for MTU settings + cat >/etc/hotplug.d/iface/99-mtu <<__MTU__ + #!/bin/sh + + ${concatMapStrings (net: + optionalString (config.site.net ? ${net} && + config.site.net.${net}.mtu != null) '' + if [ "\\\$ACTION" = ifup -a "\\\$INTERFACE" = ${net} ]; then + ip link set ${net} mtu ${toString config.site.net.${net}.mtu} + fi + '') (builtins.attrNames hostConfig.interfaces) + } + __MTU__ + ${optionalString hostConfig.wifiOnLink.enable '' # Cronjob that makes sure WiFi is only visible when server with all # the gateways is reachable