From da0bea0d10020bfd76d2f763965947db905cab9b Mon Sep 17 00:00:00 2001 From: Ruben Herold Date: Fri, 4 Sep 2026 11:03:16 +0200 Subject: dhcp-server: T9267: drop standalone substring "length" option The byte length compared by a hostname/vendor-class-id "substring" match is always derived from "value" for a meaningful equality test: a shorter length never matches (comparing fewer option bytes against the full value literal), and a longer one is silently clamped by Kea to the available bytes, turning what looks like a prefix match into an exact match of the whole remainder. There is no legitimate use for setting it independently of "value", so drop the leaf rather than add another verify() constraint around it. Reported by alexk37 in review of PR #5436. --- python/vyos/kea.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/kea.py b/python/vyos/kea.py index b782111c9..71ec82045 100644 --- a/python/vyos/kea.py +++ b/python/vyos/kea.py @@ -749,7 +749,7 @@ def _build_option_match_condition(option_number, match_config): # length is expressed in bytes; a hex literal is '0x' + 2 hex digits per # byte, rounded up since Kea itself pads an odd number of hex digits # with a leading zero - length = substring_config.get('length') or str((len(value_hex) - 1) // 2) + length = str((len(value_hex) - 1) // 2) return f'substring({kea_path}.hex, {offset}, {length}) == {value_hex}' return _build_hex_condition(kea_path, match_config['value']) -- cgit v1.2.3