From: Alan T. DeKok Date: Sun, 17 Jan 2021 15:26:29 +0000 (-0500) Subject: dhcpv4 encode / decode does not support array of dns_label X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a333973a080fbcc14d0fc9cbfec9144ba975b68;p=thirdparty%2Ffreeradius-server.git dhcpv4 encode / decode does not support array of dns_label once the code is fixed, we will update the dictionaries --- diff --git a/share/dictionary/dhcpv4/dictionary.rfc2131 b/share/dictionary/dhcpv4/dictionary.rfc2131 index 3909fdc0d12..f77f7b63e90 100644 --- a/share/dictionary/dhcpv4/dictionary.rfc2131 +++ b/share/dictionary/dhcpv4/dictionary.rfc2131 @@ -183,8 +183,8 @@ ATTRIBUTE NDS-Tree-Name 86 octets ATTRIBUTE NDS-Context 87 octets # RFC 4280 - Broadcast and Multicast Control Servers -ATTRIBUTE BCMS-Server-IPv4-FQDN 88 string array -ATTRIBUTE BCMS-Server-IPv4-Address 89 ipaddr array +ATTRIBUTE BCMS-Server-IPv4-FQDN 88 octets # really dns_label array +ATTRIBUTE BCMS-Server-IPv4-Address 89 ipaddr array # Authentication ATTRIBUTE Authentication 90 octets @@ -273,9 +273,9 @@ ATTRIBUTE MoS-IPv4-Address-CS .2 ipaddr array ATTRIBUTE MoS-IPv4-Address-ES .3 ipaddr array ATTRIBUTE MoS-IPv4-FQDN 140 tlv -ATTRIBUTE MoS-IPv4-FQDN-IS .1 string array # and dns_label -ATTRIBUTE MoS-IPv4-FQDN-CS .2 string array # and dns_label -ATTRIBUTE MoS-IPv4-FQDN-ES .3 string array # and dns_label +ATTRIBUTE MoS-IPv4-FQDN-IS .1 octets # really dns_label array +ATTRIBUTE MoS-IPv4-FQDN-CS .2 octets # really dns_label array +ATTRIBUTE MoS-IPv4-FQDN-ES .3 octets # really dns_label array # RFC 6011 - SIP UA Configuration Service Domains ATTRIBUTE SIP-UA-Configuration-Service-Domains 141 string diff --git a/src/protocols/dhcpv4/base.c b/src/protocols/dhcpv4/base.c index 06e36a01005..5dc3480250b 100644 --- a/src/protocols/dhcpv4/base.c +++ b/src/protocols/dhcpv4/base.c @@ -660,6 +660,11 @@ static fr_table_num_ordered_t const subtype_table[] = { static bool attr_valid(UNUSED fr_dict_t *dict, UNUSED fr_dict_attr_t const *parent, UNUSED char const *name, UNUSED int attr, fr_type_t type, fr_dict_attr_flags_t *flags) { + if (flags->array && !flags->length) { + fr_strerror_const("Variable length attributes cannot be marked as 'array'"); + return false; + } + /* * "extra" signifies that subtype is being used by the * dictionaries itself.