From: Roy Marples Date: Wed, 19 Jun 2019 20:33:57 +0000 (+0100) Subject: script: enable if_ssid again X-Git-Tag: v8.0.0~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2901fe40fd90c39796a2b6b1a93fb61661cec1e;p=thirdparty%2Fdhcpcd.git script: enable if_ssid again --- diff --git a/src/script.c b/src/script.c index 8297eda6..2874b7ab 100644 --- a/src/script.c +++ b/src/script.c @@ -378,25 +378,16 @@ make_env(const struct interface *ifp, const char *reason) if (efprintf(fp, "profile=%s", ifp->profile) == -1) goto eexit; } -#if 0 if (ifp->wireless) { - static const char *pfx = "ifssid="; - size_t pfx_len; - ssize_t psl; - - pfx_len = strlen(pfx); - psl = print_string(NULL, 0, OT_ESCSTRING, - (const uint8_t *)ifp->ssid, ifp->ssid_len); - if (psl != -1) { - EMALLOC(elen, pfx_len + (size_t)psl + 1); - memcpy(env[elen], pfx, pfx_len); - print_string(env[elen] + pfx_len, (size_t)psl + 1, - OT_ESCSTRING, - (const uint8_t *)ifp->ssid, ifp->ssid_len); - elen++; + char pssid[IF_SSIDLEN * 4]; + + if (print_string(pssid, sizeof(pssid), OT_ESCSTRING, + ifp->ssid, ifp->ssid_len) != -1) + { + if (efprintf(fp, "ifssid=%s", pssid) == -1) + goto eexit; } } -#endif #ifdef INET if (protocol == PROTO_DHCP && state && state->old) { if (dhcp_env(fp, "old", ifp,