From: Alan T. DeKok Date: Thu, 10 Mar 2022 22:35:06 +0000 (-0500) Subject: get network length, which is a bit different... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0139e0baa71b8e89e2f806d85aa25c9a8f75dd2;p=thirdparty%2Ffreeradius-server.git get network length, which is a bit different... 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. --- diff --git a/src/protocols/dhcpv4/encode.c b/src/protocols/dhcpv4/encode.c index e952eb0c207..2e2dbef8c88 100644 --- a/src/protocols/dhcpv4/encode.c +++ b/src/protocols/dhcpv4/encode.c @@ -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