Pair and extended community constructors may reject values only known during filter evaluation. Include the evaluated components that determine these errors so operators can identify the failing data without reproducing a route. Large community fields use the full 32-bit integer range and need no additional range check. Target: patch --- filter/f-inst.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/filter/f-inst.c b/filter/f-inst.c index 967887f6..3a339f47 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -338,7 +338,8 @@ uint u1 = v1.val.i; uint u2 = v2.val.i; if ((u1 > 0xFFFF) || (u2 > 0xFFFF)) - runtime( "Can't operate with value out of bounds in pair constructor" ); + runtime("Pair component out of range 0..65535 (got %u, %u)", + u1, u2); RESULT(T_PAIR, i, (u1 << 16) | u2); } @@ -372,14 +373,16 @@ if (val <= 0xFFFF) RESULT(T_EC, ec, ec_ip4(ecs, key, val)); else - runtime("4-byte value %u can't be used with IP-address key in extended community", val); + runtime("Extended community value out of range 0..65535 " + "(IPv4 key %I, value %u)", ipa_from_u32(key), val); else if (key < 0x10000) RESULT(T_EC, ec, ec_as2(ecs, key, val)); else if (val <= 0xFFFF) RESULT(T_EC, ec, ec_as4(ecs, key, val)); else - runtime("4-byte value %u can't be used with 4-byte ASN in extended community", val); + runtime("Extended community value out of range 0..65535 " + "(4-byte ASN %u, value %u)", key, val); } INST(FI_LC_CONSTRUCT, 3, 1) { base-commit: 06ca9bf5c588df6c0587eb64bd375eb0ade526ab -- 2.47.3