From: Boris Sukholitko Date: Wed, 29 Sep 2021 11:32:23 +0000 (+0300) Subject: dissector: do not set invalid PPP protocol X-Git-Tag: v6.1-rc5~2768^2~321 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e861e5e97175dfa7b7bc055c45acdc06d2301d3;p=platform%2Fkernel%2Flinux-starfive.git dissector: do not set invalid PPP protocol The following flower filter fails to match non-PPP_IP{V6} packets wrapped in PPP_SES protocol: tc filter add dev eth0 ingress protocol ppp_ses flower \ action simple sdata hi64 The reason is that proto local variable is being set even when FLOW_DISSECT_RET_OUT_BAD status is returned. The fix is to avoid setting proto variable if the PPP protocol is unknown. Signed-off-by: Boris Sukholitko Signed-off-by: David S. Miller --- diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index bac0184..7d0a9f8 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -1196,9 +1196,8 @@ proto_again: break; } - proto = hdr->proto; nhoff += PPPOE_SES_HLEN; - switch (proto) { + switch (hdr->proto) { case htons(PPP_IP): proto = htons(ETH_P_IP); fdret = FLOW_DISSECT_RET_PROTO_AGAIN;