]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP6: Revert part of prior - only allow vendorclassid to disable
authorRoy Marples <roy@marples.name>
Thu, 28 May 2020 08:02:13 +0000 (09:02 +0100)
committerRoy Marples <roy@marples.name>
Thu, 28 May 2020 08:03:26 +0000 (09:03 +0100)
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.

src/dhcp6.c

index 578f2834903ce71f43e21499cdf86d3aa9b9723c..a24277c30171a7dccf36336768f0f924ab5ff939 100644 (file)
@@ -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);
                }
        }