From 8d968fdd991d3471aa9b484eac58708786c48d85 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 24 Jul 2019 14:46:55 +0900 Subject: network: support matching based on wifi SSID --- src/libsystemd-network/network-internal.c | 7 ++++++- src/libsystemd-network/network-internal.h | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/libsystemd-network') 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); -- cgit v1.2.3