summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-07-24 08:32:24 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-10-14 18:59:56 +0200
commit277ba8d1ab968f4c699c623a6bb17bd3b5fd17eb (patch)
tree1e2e6e50e94ef5b232d5bb62bc29e2cc7025190c /src/libsystemd-network
parentnetwork: also read BSSID (diff)
downloadsystemd-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.c7
-rw-r--r--src/libsystemd-network/network-internal.h4
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);