From 4c53a6b9e7f4385f02177659d91c4b7e8faae30d Mon Sep 17 00:00:00 2001 From: Charanjith Kunduru Date: Thu, 26 Mar 2026 12:21:38 -0700 Subject: [PATCH 1/2] Fix fragment-offset-range pattern escaping in single-quoted strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pattern and posix-pattern for fragment-offset-range use '\\.' (double backslash) in single-quoted YANG strings. Since single-quoted strings have no escape processing (RFC 7950 Section 6.1.3), '\\.' stores as literal backslash-backslash-dot, which in regex means "literal backslash followed by any character" — not the intended "literal dot". All other patterns in the OpenConfig models correctly use '\.' (single backslash) for literal dot matching in single-quoted strings (e.g. area-address in openconfig-isis-types.yang). --- .../openconfig-packet-match-types-test.yang | 19 +++++++++++++++++++ .../acl/openconfig-packet-match-types.yang | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/regexp-tests/openconfig-packet-match-types-test.yang b/regexp-tests/openconfig-packet-match-types-test.yang index d386af0046..f213b583a8 100644 --- a/regexp-tests/openconfig-packet-match-types-test.yang +++ b/regexp-tests/openconfig-packet-match-types-test.yang @@ -26,4 +26,23 @@ module openconfig-packet-match-types-test { pt:pattern-test-fail "66999..67890"; pt:pattern-test-fail "70000..70000"; } + + leaf fragment-offset-range { + type oc-pkt-match-types:fragment-offset-range; + pt:pattern-test-pass "0..0"; + pt:pattern-test-pass "0..8191"; + pt:pattern-test-pass "8191..8191"; + pt:pattern-test-pass "100..200"; + pt:pattern-test-pass "00..00"; + pt:pattern-test-pass "0000..0000"; + pt:pattern-test-pass "1234..5678"; + pt:pattern-test-pass "7999..8191"; + pt:pattern-test-fail "100.200"; + pt:pattern-test-fail "0.8191"; + pt:pattern-test-fail "0..8192"; + pt:pattern-test-fail "8192..8192"; + pt:pattern-test-fail "9999..9999"; + pt:pattern-test-fail "10000..10000"; + pt:pattern-test-fail "-1..10"; + } } diff --git a/release/models/acl/openconfig-packet-match-types.yang b/release/models/acl/openconfig-packet-match-types.yang index 8c4ae88cf0..a4df5dcc22 100644 --- a/release/models/acl/openconfig-packet-match-types.yang +++ b/release/models/acl/openconfig-packet-match-types.yang @@ -383,12 +383,12 @@ module openconfig-packet-match-types { type string { pattern '(0{0,3}[0-9]|0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' - + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\\.\\.(0{0,3}[0-9]|' + + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\.\.(0{0,3}[0-9]|' + '0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' + '80[0-9]{2}|81[0-8][0-9]|819[0-1])'; oc-ext:posix-pattern '^((0{0,3}[0-9]|0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' - + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\\.\\.(0{0,3}[0-9]|' + + '80[0-9]{2}|81[0-8][0-9]|819[0-1])\.\.(0{0,3}[0-9]|' + '0{0,2}[1-9][0-9]|0?[1-9][0-9]{2}|[1-7][0-9]{3}|' + '80[0-9]{2}|81[0-8][0-9]|819[0-1]))$'; } From a42cdf7fe0aeeedf440e8c47993e8a68f958a2e3 Mon Sep 17 00:00:00 2001 From: Darren Loher Date: Tue, 19 May 2026 09:29:56 -0700 Subject: [PATCH 2/2] Update release/models/acl/openconfig-packet-match-types.yang --- release/models/acl/openconfig-packet-match-types.yang | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/release/models/acl/openconfig-packet-match-types.yang b/release/models/acl/openconfig-packet-match-types.yang index a4df5dcc22..50575e5e31 100644 --- a/release/models/acl/openconfig-packet-match-types.yang +++ b/release/models/acl/openconfig-packet-match-types.yang @@ -29,7 +29,13 @@ module openconfig-packet-match-types { description "Add pattern regex for Fragment Offset range"; reference "1.3.4"; - } +oc-ext:openconfig-version "1.3.5"; + +revision "2026-05-12" { +description +"Fix pattern regex for Fragment Offset range"; +reference "1.3.5"; +} revision "2023-01-29" { description