summaryrefslogtreecommitdiffstats
path: root/src/libsystemd-network
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-07-24 07:46:55 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-10-14 18:59:06 +0200
commit8d968fdd991d3471aa9b484eac58708786c48d85 (patch)
tree995c8ba42dab376d1d8c9ce1e7bae4989fe7cd6b /src/libsystemd-network
parentnetwork: introduce link_reconfigure() (diff)
downloadsystemd-8d968fdd991d3471aa9b484eac58708786c48d85.tar.xz
systemd-8d968fdd991d3471aa9b484eac58708786c48d85.zip
network: support matching based on wifi SSID
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 1f2e5c7e65..08c756788e 100644
--- a/src/libsystemd-network/network-internal.c
+++ b/src/libsystemd-network/network-internal.c
@@ -142,9 +142,11 @@ bool net_match_config(Set *match_mac,
char * const *match_types,
char * const *match_names,
char * const *match_property,
+ char * const *match_ssid,
sd_device *device,
const struct ether_addr *dev_mac,
- const char *dev_name) {
+ const char *dev_name,
+ const char *ssid) {
const char *dev_path = NULL, *dev_driver = NULL, *dev_type = NULL, *mac_str;
@@ -178,6 +180,9 @@ bool net_match_config(Set *match_mac,
if (!net_condition_test_property(match_property, device))
return false;
+ if (!net_condition_test_strv(match_ssid, ssid))
+ return false;
+
return true;
}
diff --git a/src/libsystemd-network/network-internal.h b/src/libsystemd-network/network-internal.h
index 7059c8ae45..71aec1a99b 100644
--- a/src/libsystemd-network/network-internal.h
+++ b/src/libsystemd-network/network-internal.h
@@ -20,9 +20,11 @@ bool net_match_config(Set *match_mac,
char * const *match_type,
char * const *match_name,
char * const *match_property,
+ char * const *match_ssid,
sd_device *device,
const struct ether_addr *dev_mac,
- const char *dev_name);
+ const char *dev_name,
+ const char *ssid);
CONFIG_PARSER_PROTOTYPE(config_parse_net_condition);
CONFIG_PARSER_PROTOTYPE(config_parse_hwaddr);