diff options
| author | Roy Marples <roy@marples.name> | 2014-09-10 10:00:08 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-09-10 10:00:08 +0000 |
| commit | 71650ebcdedb8250c6a3a6384ef7aabf4be7c650 (patch) | |
| tree | de06ff4f7f82feed3d95272658fe9d21d7b34313 /dhcpcd.c | |
| parent | fc44b8dc62d75dc44cd277c537e1fb22fac6c181 (diff) | |
| download | dhcpcd-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.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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; |
