diff options
| author | Lu Qiuwen <[email protected]> | 2023-10-10 09:45:23 +0800 |
|---|---|---|
| committer | 陆秋文 <[email protected]> | 2023-10-10 01:47:48 +0000 |
| commit | 57e467e0e384434ef05f249860b5d25ec9bfd03c (patch) | |
| tree | 1c0ff772ffa1a7b7c33844343912af986b1d3b0f /app/src | |
| parent | 030f4cab0cceb3ffad4bfca656c2ce4afb3d7c40 (diff) | |
修正将vxlan报文送入tap representor的问题。
Diffstat (limited to 'app/src')
| -rw-r--r-- | app/src/tap.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/src/tap.c b/app/src/tap.c index e389a90..edc41a3 100644 --- a/app/src/tap.c +++ b/app/src/tap.c @@ -112,11 +112,22 @@ static int tap_resp_dev_filter(struct vdev * vdev_desc, struct rte_mbuf * mbuf) LAYER_TYPE_ID_IPV4, LAYER_TYPE_ID_UDP, }; + static const uint16_t exp_ipv4_others[] = { LAYER_TYPE_ID_ETHER, LAYER_TYPE_ID_IPV4, }; + if(parser_result->nr_layers == 3 || parser_result->nr_layers == 2) + { + goto compare_layers; + } + else + { + return 0; + } + +compare_layers: if (complex_layer_type_expect(parser_result, exp_ipv4_tcp, RTE_DIM(exp_ipv4_tcp)) == 0 || complex_layer_type_expect(parser_result, exp_ipv4_udp, RTE_DIM(exp_ipv4_udp)) == 0 || complex_layer_type_expect(parser_result, exp_ipv4_others, RTE_DIM(exp_ipv4_others)) == 0) |
