]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Rework prior so it works.
authorRoy Marples <roy@marples.name>
Mon, 20 Jun 2016 13:02:35 +0000 (13:02 +0000)
committerRoy Marples <roy@marples.name>
Mon, 20 Jun 2016 13:02:35 +0000 (13:02 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 2064ce8e52739a7ebd6795c964e60e90bf11c21b..a743296ce1b5b129f4fcd4caa67f442ff779c556 100644 (file)
--- 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) &&