summary refs log tree commit diff
diff options
context:
space:
mode:
authorRyan Lahfa <masterancpp@gmail.com>2023-07-28 19:19:02 +0200
committerGitHub <noreply@github.com>2023-07-28 19:19:02 +0200
commit2a0aaa7e8fddc9417f6700dc031f3731171af99a (patch)
tree11dc46921bcb91ecfc80d4c6916da235ff43eab1
parent868ced9c6dab015f34196f2af0cd69854b17e6f2 (diff)
parent0ac2ba763f586e432b26f52e97c06ea869a01523 (diff)
downloadnixpkgs-2a0aaa7e8fddc9417f6700dc031f3731171af99a.tar
nixpkgs-2a0aaa7e8fddc9417f6700dc031f3731171af99a.tar.gz
nixpkgs-2a0aaa7e8fddc9417f6700dc031f3731171af99a.tar.bz2
nixpkgs-2a0aaa7e8fddc9417f6700dc031f3731171af99a.tar.lz
nixpkgs-2a0aaa7e8fddc9417f6700dc031f3731171af99a.tar.xz
nixpkgs-2a0aaa7e8fddc9417f6700dc031f3731171af99a.tar.zst
nixpkgs-2a0aaa7e8fddc9417f6700dc031f3731171af99a.zip
Merge pull request #245413 from oddlama/fix-hostapd-mac-allow
-rw-r--r--nixos/modules/services/networking/hostapd.nix7
-rw-r--r--nixos/tests/wpa_supplicant.nix1
2 files changed, 3 insertions, 5 deletions
diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix
index 0a6c3f2a656..924abfc2953 100644
--- a/nixos/modules/services/networking/hostapd.nix
+++ b/nixos/modules/services/networking/hostapd.nix
@@ -921,9 +921,7 @@ in {
                 };
 
                 config = let
-                  bss = bssSubmod.name;
                   bssCfg = bssSubmod.config;
-
                   pairwiseCiphers =
                     concatStringsSep " " (unique (bssCfg.authentication.pairwiseCiphers
                       ++ optionals bssCfg.authentication.enableRecommendedPairwiseCiphers ["CCMP" "CCMP-256" "GCMP" "GCMP-256"]));
@@ -964,9 +962,9 @@ in {
                   } // optionalAttrs (bssCfg.bssid != null) {
                     bssid = bssCfg.bssid;
                   } // optionalAttrs (bssCfg.macAllow != [] || bssCfg.macAllowFile != null || bssCfg.authentication.saeAddToMacAllow) {
-                    accept_mac_file = "/run/hostapd/${bss}.mac.allow";
+                    accept_mac_file = "/run/hostapd/${bssCfg._module.args.name}.mac.allow";
                   } // optionalAttrs (bssCfg.macDeny != [] || bssCfg.macDenyFile != null) {
-                    deny_mac_file = "/run/hostapd/${bss}.mac.deny";
+                    deny_mac_file = "/run/hostapd/${bssCfg._module.args.name}.mac.deny";
                   } // optionalAttrs (bssCfg.authentication.mode == "none") {
                     wpa = mkDefault 0;
                   } // optionalAttrs (bssCfg.authentication.mode == "wpa3-sae") {
@@ -1051,7 +1049,6 @@ in {
           };
 
           config.settings = let
-            radio = radioSubmod.name;
             radioCfg = radioSubmod.config;
           in {
             driver = radioCfg.driver;
diff --git a/nixos/tests/wpa_supplicant.nix b/nixos/tests/wpa_supplicant.nix
index 4f000df922c..8c701ca7d5f 100644
--- a/nixos/tests/wpa_supplicant.nix
+++ b/nixos/tests/wpa_supplicant.nix
@@ -34,6 +34,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...}:
               ssid = "nixos-test-mixed";
               authentication = {
                 mode = "wpa3-sae-transition";
+                saeAddToMacAllow = true;
                 saePasswordsFile = pkgs.writeText "password" "reproducibility";
                 wpaPasswordFile = pkgs.writeText "password" "reproducibility";
               };