Mark Client FQDN (option 81) as concatenation-requiring per
RFC 4702, Section 2. When the encoded FQDN exceeds 255 bytes,
fill() now splits it across DHCP message fields using the RFC 3396
splitting infrastructure instead of silently dropping it.
Link: https://bugs.passt.top/show_bug.cgi?id=192
Signed-off-by: Anshu Kumari
---
v5:
- New patch: mark Client FQDN (optionĀ 81) as concatenation-requiring per RFC 4702
---
dhcp.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/dhcp.c b/dhcp.c
index 6bebb5f..a54ac58 100644
--- a/dhcp.c
+++ b/dhcp.c
@@ -484,9 +484,15 @@ enum dhcp_overload {
*/
static bool is_concat_opt(int o)
{
- if ((size_t)o >= ARRAY_SIZE(dhcp_opt_types))
- return false;
- return dhcp_opt_types[o] == DHCP_OPT_STR_CONCAT;
+ if ((size_t)o < ARRAY_SIZE(dhcp_opt_types) &&
+ dhcp_opt_types[o] == DHCP_OPT_STR_CONCAT)
+ return true;
+
+ /* RFC 4702, Section 2: Client FQDN option requires concatenation */
+ if (o == 81)
+ return true;
+
+ return false;
}
/**
--
2.54.0