From: Roy Marples Date: Mon, 20 Jun 2016 13:02:35 +0000 (+0000) Subject: Rework prior so it works. X-Git-Tag: v6.11.2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2600fd4b728dea2a517c042264177e366b29a69;p=thirdparty%2Fdhcpcd.git Rework prior so it works. --- diff --git a/dhcp6.c b/dhcp6.c index 2064ce8e..a743296c 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -171,9 +171,6 @@ dhcp6_makevendor(struct dhcp6_option *o, const struct interface *ifp) char vendor[VENDORCLASSID_MAX_LEN]; ifo = ifp->options; - if (has_option_mask(ifo->nomask6, D6_OPTION_VENDOR_CLASS)) - return 0; - len = sizeof(uint32_t); /* IANA PEN */ if (ifo->vivco_en) { for (i = 0, vivco = ifo->vivco; @@ -591,7 +588,8 @@ dhcp6_makemessage(struct interface *ifp) len += sizeof(*state->send); len += sizeof(*o) + ifp->ctx->duid_len; len += sizeof(*o) + sizeof(uint16_t); /* elapsed */ - len += sizeof(*o) + dhcp6_makevendor(NULL, ifp); + if (!has_option_mask(ifo->nomask6, D6_OPTION_VENDOR_CLASS)) + len += sizeof(*o) + dhcp6_makevendor(NULL, ifp); /* IA */ m = NULL; @@ -740,8 +738,10 @@ dhcp6_makemessage(struct interface *ifp) p = D6_OPTION_DATA(o); memset(p, 0, sizeof(uint16_t)); - o = D6_NEXT_OPTION(o); - dhcp6_makevendor(o, ifp); + if (!has_option_mask(ifo->nomask6, D6_OPTION_VENDOR_CLASS)) { + o = D6_NEXT_OPTION(o); + dhcp6_makevendor(o, ifp); + } if (state->state == DH6S_DISCOVER && !(ifp->ctx->options & DHCPCD_TEST) &&