summaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 1ac9e81..7aa046d 100644
--- a/src/config.c
+++ b/src/config.c
@@ -102,6 +102,15 @@ bool fastd_config_ifname(fastd_peer_t *peer, const char *ifname) {
if (strchr(ifname, '/'))
return false;
+ const char *percent = strchr(ifname, '%');
+ if (percent) {
+ if (strrchr(ifname, '%') != percent)
+ return false; /* Multiple patterns */
+
+ if (percent[1] != 'n' && percent[1] != 'k')
+ return false;
+ }
+
char **name = peer ? &peer->ifname : &conf.ifname;
free(*name);