Skip to contentSkip to conversation

exthdr: remove tcp dependency for tcp option matching

PATCH In review Florian Westphal 2 participants 2 messages Jan 21, 2021 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 exthdr: remove tcp dependency for tcp option matching

Kernel won't search for tcp options in non-tcp packets.

---
 src/evaluate.c                |  4 +--
 tests/py/any/tcpopt.t.payload | 60 -----------------------------------
 2 files changed, 1 insertion(+), 63 deletions(-)
src/evaluate.c +1 -3
index c830dcdbd965..ee5655064cb8 100644
@@ -580,9 +580,7 @@ static int expr_evaluate_exthdr(struct eval_ctx *ctx, struct expr **exprp)
 
 	switch (expr->exthdr.op) {
 	case NFT_EXTHDR_OP_TCPOPT:
-		dependency = &proto_tcp;
-		pb = PROTO_BASE_TRANSPORT_HDR;
-		break;
+		return __expr_evaluate_exthdr(ctx, exprp);
 	case NFT_EXTHDR_OP_IPV4:
 		dependency = &proto_ip;
 		break;
tests/py/any/tcpopt.t.payload +0 -60

210 lines not on this page · raw message

Signature · 1 line
2.26.2
#1 lore raw
Quoted 1 line · Florian Westphal

Kernel won't search for tcp options in non-tcp packets.

LGTM.