The ip option expression allows for non-sense matching like:
ip option lsrr type 1
because 'lsrr' already provides the type field, this never results in a
matching.
Turn this expression into:
ip option lsrr exists
And update documentation to hide this redundant type field.
Fixes: 226a0e072d5c ("exthdr: add support for matching IPv4 options")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|Keyword| Description | IP option fields
|lsrr|
Loose Source Route |
-type, length, ptr, addr
+length, ptr, addr
|ra|
Router Alert |
-type, length, value
+length, value
|rr|
Record Route |
-type, length, ptr, addr
+length, ptr, addr
|ssrr|
Strict Source Route |
-type, length, ptr, addr
+length, ptr, addr
|============================
.finding TCP options
erec_queue(error(&@1, "unknown ip option type/field"), state->msgs);
YYERROR;
}
+
+ if ($4 == IPOPT_FIELD_TYPE)
+ $$->exthdr.flags = NFT_EXTHDR_F_PRESENT;
}
| IP OPTION ip_option_type close_scope_ip
{