From 39fe63d375a105ed2ec18ed1a95f04c9fa6bf128 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 24 Mar 2022 16:30:30 -0400 Subject: [PATCH] manual pull of PR #4440 --- share/dictionary/dhcpv4/dictionary | 1 + share/dictionary/dhcpv4/dictionary.rfc2131 | 3 +- share/dictionary/dhcpv4/dictionary.rfc4702 | 35 +++++++++++++++++++++ src/tests/unit/protocols/dhcpv4/rfc4702.txt | 12 +++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 share/dictionary/dhcpv4/dictionary.rfc4702 create mode 100644 src/tests/unit/protocols/dhcpv4/rfc4702.txt diff --git a/share/dictionary/dhcpv4/dictionary b/share/dictionary/dhcpv4/dictionary index d6b112f454..6e22077f2e 100644 --- a/share/dictionary/dhcpv4/dictionary +++ b/share/dictionary/dhcpv4/dictionary @@ -31,6 +31,7 @@ $INCLUDE dictionary.rfc3397 $INCLUDE dictionary.rfc3442 $INCLUDE dictionary.rfc4280 $INCLUDE dictionary.rfc4578 +$INCLUDE dictionary.rfc4702 $INCLUDE dictionary.rfc4776 $INCLUDE dictionary.rfc4833 $INCLUDE dictionary.rfc5071 diff --git a/share/dictionary/dhcpv4/dictionary.rfc2131 b/share/dictionary/dhcpv4/dictionary.rfc2131 index 94839a6cb8..4ad5edb3e6 100644 --- a/share/dictionary/dhcpv4/dictionary.rfc2131 +++ b/share/dictionary/dhcpv4/dictionary.rfc2131 @@ -140,8 +140,7 @@ ATTRIBUTE STDA-Server-Address 76 ipaddr array # Rapid Commit ATTRIBUTE Rapid-Commit 80 bool encode=exists -# Fully Qualified Domain Name -ATTRIBUTE Client-FQDN 81 string + # Relay Agent Information ATTRIBUTE Relay-Agent-Information 82 tlv diff --git a/share/dictionary/dhcpv4/dictionary.rfc4702 b/share/dictionary/dhcpv4/dictionary.rfc4702 new file mode 100644 index 0000000000..5a534acf55 --- /dev/null +++ b/share/dictionary/dhcpv4/dictionary.rfc4702 @@ -0,0 +1,35 @@ +# -*- text -*- +# Copyright (C) 2022 The FreeRADIUS Server project and contributors +# This work is licensed under CC-BY version 4.0 https://creativecommons.org/licenses/by/4.0 +# Version $Id$ +############################################################################## +# +# RFC4702 - The Dynamic Host Configuration Protocol (DHCP) Client +# Fully Qualified Domain Name (FQDN) Option +# +# $Id$ +# +############################################################################## + +# +# RFC 4702 describes the Flags field, here the first four members of +# Client-FQDN, as follows: +# +# The format of the 1-octet Flags field is: +# +# 0 1 2 3 4 5 6 7 +# +-+-+-+-+-+-+-+-+ +# | MBZ |N|E|O|S| +# +-+-+-+-+-+-+-+-+ +# + +# Fully Qualified Domain Name +ATTRIBUTE Client-FQDN 81 struct +MEMBER mbz bit[4] +MEMBER no_dns_updates bit[1] +MEMBER new_dns_encoding bit[1] +MEMBER override bit[1] +MEMBER should_do_dns_updates bit[1] +MEMBER RCODE1 uint8 +MEMBER RCODE2 uint8 +MEMBER Domain-Name string dns_label diff --git a/src/tests/unit/protocols/dhcpv4/rfc4702.txt b/src/tests/unit/protocols/dhcpv4/rfc4702.txt new file mode 100644 index 0000000000..120f16cf6b --- /dev/null +++ b/src/tests/unit/protocols/dhcpv4/rfc4702.txt @@ -0,0 +1,12 @@ +proto dhcpv4 +proto-dictionary dhcpv4 +fuzzer-out dhcpv4 + +encode-pair Client-FQDN = { mbz = 0, no_dns_updates = yes, new_dns_encoding = yes, override = no, should_do_dns_updates = no, RCODE1 = 0, RCODE2 = 0, Domain-Name = "example.co.uk" } +match 51 12 0c 00 00 07 65 78 61 6d 70 6c 65 02 63 6f 02 75 6b 00 + +decode-pair - +match Client-FQDN = { mbz = 0, no_dns_updates = yes, new_dns_encoding = yes, override = no, should_do_dns_updates = no, RCODE1 = 0, RCODE2 = 0, Domain-Name = "example.co.uk" } + +count +match 7 -- 2.47.3