diff options
| author | lijia <[email protected]> | 2021-11-01 11:36:11 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2021-11-01 11:36:11 +0800 |
| commit | 46d648bbe09e244fce5ba17558bbc934f124a41e (patch) | |
| tree | 3777915c4f2f94442ca66de9db98ffe141c8ca67 | |
| parent | b6f22dc290e710dc22a00200a6fb7cf91ac1f86e (diff) | |
TSG-8262, 双臂模式I2E, E2I routedir方向值错误.v4.2.59
| -rw-r--r-- | src/packet_io/packet_io_marsio.c | 5 | ||||
| -rw-r--r-- | test/test_app_sapp.c | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/packet_io/packet_io_marsio.c b/src/packet_io/packet_io_marsio.c index bd98f34..4b144e3 100644 --- a/src/packet_io/packet_io_marsio.c +++ b/src/packet_io/packet_io_marsio.c @@ -609,7 +609,10 @@ static inline int marsio4_pkt_hand(int tid, marsio_buff_t *rx_buff, raw_pkt_t *r raw_pkt->__lib_raw_pkt_len = ptr_marsio_buff_datalen(rx_buff); raw_pkt->raw_pkt_len = raw_pkt->__lib_raw_pkt_len; raw_pkt->io_lib_pkt_reference = rx_buff; - raw_pkt->route_dir = mr_ctrlzone->route_dir; + /* ˫��ģʽdir��������internal, external����, + inlineģʽ��ʱ��dir������, ���ջ��� packet_io_hook_input_vxlan() ,ͨ��vxlan header����routedir . + */ + raw_pkt->route_dir = dir; if(unlikely(g_marsio_have_bpf == 1)) { diff --git a/test/test_app_sapp.c b/test/test_app_sapp.c index 822b54a..d5529dd 100644 --- a/test/test_app_sapp.c +++ b/test/test_app_sapp.c @@ -685,18 +685,21 @@ char ipv4_pkt_detail_entry(struct streaminfo *pstream,unsigned char routedir, in if(IPPROTO_TCP == ihdr4->ip_p){ thdr = (struct mesa_tcp_hdr *)((char *)ihdr4 + ihdr4->ip_hl * 4); - printf("IP pkt: %s:%u --> %s:%u, ipid:%u, proto:%d\n", + printf("IP pkt: %s:%u --> %s:%u, ipid:%u, proto:%d, routedir:%d\n", ip_src_str, ntohs(thdr->th_sport), ip_dst_str, ntohs(thdr->th_dport), - ntohs(ihdr4->ip_id), ihdr4->ip_p); + ntohs(ihdr4->ip_id), ihdr4->ip_p, + routedir); }else if(IPPROTO_UDP == ihdr4->ip_p){ uhdr = (struct mesa_udp_hdr *)((char *)ihdr4 + ihdr4->ip_hl * 4); - printf("IP pkt: %s:%u --> %s:%u, ipid:%u, proto:%d\n", + printf("IP pkt: %s:%u --> %s:%u, ipid:%u, proto:%d,routedir:%d\n", ip_src_str, ntohs(uhdr->uh_sport), ip_dst_str, ntohs(uhdr->uh_dport), - ntohs(ihdr4->ip_id), ihdr4->ip_p); + ntohs(ihdr4->ip_id), ihdr4->ip_p, + routedir); }else{ - printf("IP pkt: %s --> %s, ipid:%u, proto:%d\n", ip_src_str, ip_dst_str, ntohs(ihdr4->ip_id), ihdr4->ip_p); + printf("IP pkt: %s --> %s, ipid:%u, proto:%d, routedir:%d\n", + ip_src_str, ip_dst_str, ntohs(ihdr4->ip_id), ihdr4->ip_p, routedir); } return APP_STATE_GIVEME; @@ -3323,7 +3326,7 @@ char IPv6_ENTRY(const struct streaminfo *pstream,unsigned char routedir,int thre inet_ntop(AF_INET6, &ip6h->ip6_src, ips, 128); inet_ntop(AF_INET6, &ip6h->ip6_dst, ipd, 128); - printf("recv ip6 pkt, %s --> %s, protocol:%u\n", ips, ipd, ip6h->ip6_nxt_hdr); + printf("recv ip6 pkt, %s --> %s, protocol:%u, routedir:%d\n", ips, ipd, ip6h->ip6_nxt_hdr, routedir); return APP_STATE_GIVEME; } |
