]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
get network length, which is a bit different...
authorAlan T. DeKok <aland@freeradius.org>
Thu, 10 Mar 2022 22:35:06 +0000 (17:35 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 11 Mar 2022 15:41:07 +0000 (10:41 -0500)
IPv6 has 16 bytes minimum, 17 max (for scope I guess).
We're not going to copy fr_dhcpv6_option_len() as yet, so we
just hack something for now.

src/protocols/dhcpv4/encode.c

index e952eb0c207bdbfcf6374d0dc91829b7bb9be845..2e2dbef8c889ec2a84d37855439005bbc7bec50d 100644 (file)
@@ -173,7 +173,11 @@ static ssize_t encode_array(fr_dbuff_t *dbuff,
                fr_dbuff_t      element_dbuff = FR_DBUFF(&work_dbuff);
 
                vp = fr_dcursor_current(cursor);
-               element_len = vp->vp_length;
+
+               /*
+                *      @todo - get correct lengths.
+                */
+               element_len = fr_value_box_network_length(&vp->data);
 
                /*
                 *      If the data is variable length i.e. strings or octets