diff options
-rw-r--r-- | src/tcpopt.c | 2 | ||||
-rw-r--r-- | tests/shell/testcases/bogons/nft-f/tcp_option_without_template | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/tcpopt.c b/src/tcpopt.c index 8111a507..f977e417 100644 --- a/src/tcpopt.c +++ b/src/tcpopt.c @@ -224,7 +224,7 @@ struct expr *tcpopt_expr_alloc(const struct location *loc, } tmpl = &desc->templates[field]; - if (!tmpl) + if (!tmpl || !tmpl->dtype) return NULL; expr = expr_alloc(loc, EXPR_EXTHDR, tmpl->dtype, diff --git a/tests/shell/testcases/bogons/nft-f/tcp_option_without_template b/tests/shell/testcases/bogons/nft-f/tcp_option_without_template new file mode 100644 index 00000000..fd732fd3 --- /dev/null +++ b/tests/shell/testcases/bogons/nft-f/tcp_option_without_template @@ -0,0 +1 @@ +add rule f i tcp option nop length . @ih,32,3 1 |