summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-09-10 10:00:08 +0000
committerRoy Marples <roy@marples.name>2014-09-10 10:00:08 +0000
commit71650ebcdedb8250c6a3a6384ef7aabf4be7c650 (patch)
treede06ff4f7f82feed3d95272658fe9d21d7b34313 /dhcpcd.c
parentfc44b8dc62d75dc44cd277c537e1fb22fac6c181 (diff)
downloaddhcpcd-71650ebcdedb8250c6a3a6384ef7aabf4be7c650.tar.xz
Allow SSIDs with non printable characters to be used in ssid selection in
dhcpcd.conf and generate more accurate stable private addresses.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index dd684147..8dbebd7a 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -489,8 +489,18 @@ int
dhcpcd_selectprofile(struct interface *ifp, const char *profile)
{
struct if_options *ifo;
-
- ifo = read_config(ifp->ctx, ifp->name, ifp->ssid, profile);
+ char pssid[PROFILE_LEN];
+
+ if (ifp->ssid_len) {
+ ssize_t r;
+ r =print_string(pssid, sizeof(pssid), ifp->ssid, ifp->ssid_len);
+ if (r == -1) {
+ syslog(LOG_ERR, "%s: %s: %m", ifp->name, __func__);
+ pssid[0] = '\0';
+ }
+ } else
+ pssid[0] = '\0';
+ ifo = read_config(ifp->ctx, ifp->name, pssid, profile);
if (ifo == NULL) {
syslog(LOG_DEBUG, "%s: no profile %s", ifp->name, profile);
return -1;