Skip to content

Commit 3a1214e

Browse files
Tom Herbertdavem330
authored andcommitted
flow_dissector: Cleanup control flow
__skb_flow_dissect is riddled with gotos that make discerning the flow, debugging, and extending the capability difficult. This patch reorganizes things so that we only perform goto's after the two main switch statements (no gotos within the cases now). It also eliminates several goto labels so that there are only two labels that can be target for goto. Reported-by: Alexander Popov <alex.popov@linux.com> Signed-off-by: Tom Herbert <tom@quantonium.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2c08ab3 commit 3a1214e

2 files changed

Lines changed: 153 additions & 78 deletions

File tree

‎include/net/flow_dissector.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ struct flow_dissector_key_control {
1919
#define FLOW_DIS_FIRST_FRAG BIT(1)
2020
#define FLOW_DIS_ENCAPSULATION BIT(2)
2121

22+
enum flow_dissect_ret {
23+
FLOW_DISSECT_RET_OUT_GOOD,
24+
FLOW_DISSECT_RET_OUT_BAD,
25+
FLOW_DISSECT_RET_PROTO_AGAIN,
26+
FLOW_DISSECT_RET_IPPROTO_AGAIN,
27+
FLOW_DISSECT_RET_CONTINUE,
28+
};
29+
2230
/**
2331
* struct flow_dissector_key_basic:
2432
* @thoff: Transport header offset

0 commit comments

Comments
 (0)