From: Phil Sutter Date: Sat, 5 May 2018 12:44:53 +0000 (+0200) Subject: scanner: Support rfc4291 IPv4-compatible addresses X-Git-Tag: v0.8.5~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f82ef3d0dbf2788fd24ecb20299f99c190ea7ec;p=thirdparty%2Fnftables.git scanner: Support rfc4291 IPv4-compatible addresses These are defined in section 2.5.5.1. Although it is stated that they are deprecated and new implementations are not required to support them, they occur in ruleset output if an address in the form '::feed:babe' was given in input. In order to support reinsertion of that rule, we have to support those deprecated addresses as well. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/scanner.l b/src/scanner.l index 5f21bfd7..70366d19 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -158,10 +158,11 @@ v632 ((({hex4}:){2})((:{hex4}){1})) v633 ((({hex4}:){3})(:)) v63 ({v630}|{v631}|{v632}|{v633}) v620 ((:)((:{hex4}){2})) +v620_rfc4291 ((:)(:{ip4addr})) v621 ((({hex4}:){1})((:{hex4}){1})) v622 ((({hex4}:){2})(:)) v62_rfc4291 ((:)(:[fF]{4})(:{ip4addr})) -v62 ({v620}|{v621}|{v622}|{v62_rfc4291}) +v62 ({v620}|{v621}|{v622}|{v62_rfc4291}|{v620_rfc4291}) v610 ((:)(:{hex4}{1})) v611 ((({hex4}:){1})(:)) v61 ({v610}|{v611})