diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-02-16 21:22:39 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-02-21 23:57:27 +0100 |
commit | f79c7a531744b44d3e7d2752332361f1ef2dce2e (patch) | |
tree | 58828f0523cc56c2a37c475483d66a9ce9d198b7 /src/scanner.l | |
parent | 114ba9606cb5ad85b2215e59f8af8ad97a16cac8 (diff) |
src: use start condition with new destroy command
tests/py reports the following problem:
any/ct.t: ERROR: line 116: add rule ip test-ip4 output ct event set new | related | destroy | label: This rule should not have failed.
any/ct.t: ERROR: line 117: add rule ip test-ip4 output ct event set new,related,destroy,label: This rule should not have failed.
any/ct.t: ERROR: line 118: add rule ip test-ip4 output ct event set new,destroy: This rule should not have failed.
Use start condition and update parser to handle 'destroy' keyword.
Fixes: e1dfd5cc4c46 ("src: add support to command "destroy")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/scanner.l')
-rw-r--r-- | src/scanner.l | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/scanner.l b/src/scanner.l index c0c49b97..bc5b5b62 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -216,6 +216,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) %s SCANSTATE_TYPE %s SCANSTATE_VLAN %s SCANSTATE_XT +%s SCANSTATE_CMD_DESTROY %s SCANSTATE_CMD_EXPORT %s SCANSTATE_CMD_IMPORT %s SCANSTATE_CMD_LIST @@ -359,7 +360,8 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "import" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_IMPORT); return IMPORT; } "export" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_EXPORT); return EXPORT; } "monitor" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_MONITOR); return MONITOR; } -"destroy" { return DESTROY; } +"destroy" { scanner_push_start_cond(yyscanner, SCANSTATE_CMD_DESTROY); return DESTROY; } + "position" { return POSITION; } "index" { return INDEX; } |