Merge pull request #63699 from NinjaTrappeur/nin-hostapd-noscan

hostapd: add noscan mode
This commit is contained in:
Graham Christensen 2019-06-25 18:08:58 -04:00 committed by GitHub
commit 7b8a7cee78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View File

@ -30,10 +30,11 @@ let
ctrl_interface=/run/hostapd ctrl_interface=/run/hostapd
ctrl_interface_group=${cfg.group} ctrl_interface_group=${cfg.group}
${if cfg.wpa then '' ${optionalString cfg.wpa ''
wpa=2 wpa=2
wpa_passphrase=${cfg.wpaPassphrase} wpa_passphrase=${cfg.wpaPassphrase}
'' else ""} ''}
${optionalString cfg.noScan "noscan=1"}
${cfg.extraConfig} ${cfg.extraConfig}
'' ; '' ;
@ -69,6 +70,14 @@ in
''; '';
}; };
noScan = mkOption {
default = false;
description = ''
Do not scan for overlapping BSSs in HT40+/- mode.
Caution: turning this on will violate regulatory requirements!
'';
};
driver = mkOption { driver = mkOption {
default = "nl80211"; default = "nl80211";
example = "hostapd"; example = "hostapd";
@ -162,6 +171,7 @@ in
after = [ "sys-subsystem-net-devices-${escapedInterface}.device" ]; after = [ "sys-subsystem-net-devices-${escapedInterface}.device" ];
bindsTo = [ "sys-subsystem-net-devices-${escapedInterface}.device" ]; bindsTo = [ "sys-subsystem-net-devices-${escapedInterface}.device" ];
requiredBy = [ "network-link-${cfg.interface}.service" ]; requiredBy = [ "network-link-${cfg.interface}.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = serviceConfig =
{ ExecStart = "${pkgs.hostapd}/bin/hostapd ${configFile}"; { ExecStart = "${pkgs.hostapd}/bin/hostapd ${configFile}";

View File

@ -1,7 +1,11 @@
{ stdenv, fetchurl, pkgconfig, libnl, openssl, sqlite ? null }: { stdenv, fetchurl, pkgconfig, libnl, openssl, sqlite ? null }:
with stdenv.lib; with stdenv.lib;
stdenv.mkDerivation rec { let noScanPatch = fetchurl {
url="https://git.telliq.com/gtu/openwrt/raw/master/package/network/services/hostapd/patches/300-noscan.patch";
sha256 = "04wg4yjc19wmwk6gia067z99gzzk9jacnwxh5wyia7k5wg71yj5k";
};
in stdenv.mkDerivation rec {
name = "hostapd-${version}"; name = "hostapd-${version}";
version = "2.8"; version = "2.8";
@ -13,6 +17,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libnl openssl sqlite ]; buildInputs = [ libnl openssl sqlite ];
patches = [ noScanPatch ];
outputs = [ "out" "man" ]; outputs = [ "out" "man" ];
extraConfig = '' extraConfig = ''
@ -66,7 +72,7 @@ stdenv.mkDerivation rec {
repositories.git = git://w1.fi/hostap.git; repositories.git = git://w1.fi/hostap.git;
description = "A user space daemon for access point and authentication servers"; description = "A user space daemon for access point and authentication servers";
license = licenses.gpl2; license = licenses.gpl2;
maintainers = with maintainers; [ phreedom ]; maintainers = with maintainers; [ phreedom ninjatrappeur ];
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }