summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2023-03-05 23:17:13 +0100
committerGitHub <noreply@github.com>2023-03-05 23:17:13 +0100
commit4146109e5b7d8191b6f622d6b4edfb43651a6a06 (patch)
tree4d77dbafe859d762d4575c88fbc3dff65e2acce8
parentMerge pull request #219491 from NixOS/backport-218219-to-release-22.11 (diff)
parentnixos/wireguard: fix mtu after switching netns. (diff)
downloadnixpkgs-4146109e5b7d8191b6f622d6b4edfb43651a6a06.tar.gz
Merge pull request #219755 from NixOS/backport-219549-to-release-22.11
[Backport release-22.11] nixos/wireguard: fix mtu after switching netns.
-rw-r--r--nixos/modules/services/networking/wireguard.nix2
-rw-r--r--nixos/tests/wireguard/namespaces.nix1
2 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/wireguard.nix b/nixos/modules/services/networking/wireguard.nix
index e3c3d3ba3c96..631b5f4daf23 100644
--- a/nixos/modules/services/networking/wireguard.nix
+++ b/nixos/modules/services/networking/wireguard.nix
@@ -437,7 +437,7 @@ let
${ipPreMove} link add dev "${name}" type wireguard
${optionalString (values.interfaceNamespace != null && values.interfaceNamespace != values.socketNamespace) ''${ipPreMove} link set "${name}" netns "${ns}"''}
- ${optionalString (values.mtu != null) ''${ipPreMove} link set "${name}" mtu ${toString values.mtu}''}
+ ${optionalString (values.mtu != null) ''${ipPostMove} link set "${name}" mtu ${toString values.mtu}''}
${concatMapStringsSep "\n" (ip:
''${ipPostMove} address add "${ip}" dev "${name}"''
diff --git a/nixos/tests/wireguard/namespaces.nix b/nixos/tests/wireguard/namespaces.nix
index 93dc84a8768e..bf9e188e4a19 100644
--- a/nixos/tests/wireguard/namespaces.nix
+++ b/nixos/tests/wireguard/namespaces.nix
@@ -41,6 +41,7 @@ import ../make-test-python.nix ({ pkgs, lib, ... } : {
preSetup = ''
ip netns add ${interfaceNamespace}
'';
+ mtu = 1280;
inherit interfaceNamespace;
};
};