diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-24 08:32:24 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-10-14 18:59:56 +0200 |
commit | 277ba8d1ab968f4c699c623a6bb17bd3b5fd17eb (patch) | |
tree | 1e2e6e50e94ef5b232d5bb62bc29e2cc7025190c /src/libsystemd-network | |
parent | network: also read BSSID (diff) | |
download | systemd-277ba8d1ab968f4c699c623a6bb17bd3b5fd17eb.tar.xz systemd-277ba8d1ab968f4c699c623a6bb17bd3b5fd17eb.zip |
network: add support matching based on BSSID=
Diffstat (limited to 'src/libsystemd-network')
-rw-r--r-- | src/libsystemd-network/network-internal.c | 7 | ||||
-rw-r--r-- | src/libsystemd-network/network-internal.h | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c index 08c756788e..a8cb4ea286 100644 --- a/src/libsystemd-network/network-internal.c +++ b/src/libsystemd-network/network-internal.c @@ -143,10 +143,12 @@ bool net_match_config(Set *match_mac, char * const *match_names, char * const *match_property, char * const *match_ssid, + Set *match_bssid, sd_device *device, const struct ether_addr *dev_mac, const char *dev_name, - const char *ssid) { + const char *ssid, + const struct ether_addr *bssid) { const char *dev_path = NULL, *dev_driver = NULL, *dev_type = NULL, *mac_str; @@ -183,6 +185,9 @@ bool net_match_config(Set *match_mac, if (!net_condition_test_strv(match_ssid, ssid)) return false; + if (match_bssid && (!bssid || !set_contains(match_bssid, bssid))) + return false; + return true; } diff --git a/src/libsystemd-network/network-internal.h b/src/libsystemd-network/network-internal.h index 71aec1a99b..f40ad6b1dd 100644 --- a/src/libsystemd-network/network-internal.h +++ b/src/libsystemd-network/network-internal.h @@ -21,10 +21,12 @@ bool net_match_config(Set *match_mac, char * const *match_name, char * const *match_property, char * const *match_ssid, + Set *match_bssid, sd_device *device, const struct ether_addr *dev_mac, const char *dev_name, - const char *ssid); + const char *ssid, + const struct ether_addr *bssid); CONFIG_PARSER_PROTOTYPE(config_parse_net_condition); CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr); |