From: Roy Marples Date: Thu, 28 May 2020 08:02:13 +0000 (+0100) Subject: DHCP6: Revert part of prior - only allow vendorclassid to disable X-Git-Tag: v9.1.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70061ff31ab4d1c54fedad09b097fc337aac1311;p=thirdparty%2Fdhcpcd.git DHCP6: Revert part of prior - only allow vendorclassid to disable Not set. dhcpcd owns the IANA_PEN defined. Either use it as is, or get your own. This restores the prior behaviour but still allows the option as a whole to be disabled by vendorclassid being disabled. --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 578f2834..a24277c3 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -274,7 +274,9 @@ dhcp6_makevendor(void *data, const struct interface *ifp) vlen += sizeof(uint16_t) + vivco->len; len += vlen; } else if (ifo->vendorclassid[0] != '\0') { - vlen = (size_t)ifo->vendorclassid[0]; + /* dhcpcd owns DHCPCD_IANA_PEN. + * If you need your own string, get your own IANA PEN. */ + vlen = strlen(ifp->ctx->vendor); len += sizeof(uint16_t) + vlen; } else return 0; @@ -312,7 +314,7 @@ dhcp6_makevendor(void *data, const struct interface *ifp) hvlen = htons((uint16_t)vlen); memcpy(p, &hvlen, sizeof(hvlen)); p += sizeof(hvlen); - memcpy(p, ifo->vendorclassid + 1, (size_t)vlen); + memcpy(p, ifp->ctx->vendor, vlen); } }