summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-03-06 19:33:18 +0800
committeryangwei <[email protected]>2024-03-06 19:33:18 +0800
commitc714acbfdaeaea3b86e3daadd64313aafca03e8e (patch)
treef8f3200fc418e25703f6a644e0bedf7e49392bed
parent087aec0b48165eb74e385cd757735272be768228 (diff)
🐞 fix(sapp inject packet): Fix OMPUB-1176v4.3.39
修复注入反向数据包时,链路信息填充错误的bug
-rw-r--r--include/private/stream_internal.h4
-rw-r--r--src/packet_io/packet_io_marsio.c12
-rw-r--r--src/packet_io/sendpacket.c18
3 files changed, 24 insertions, 10 deletions
diff --git a/include/private/stream_internal.h b/include/private/stream_internal.h
index eee5e8b..697e892 100644
--- a/include/private/stream_internal.h
+++ b/include/private/stream_internal.h
@@ -116,7 +116,7 @@ typedef struct {
struct detain_pkt *d_pkt;
- struct rawpkt_metadata *meta[2];// ���������metadata, �����ڵ���low_level_sendʱ, ���marsio 4.6����Ҫ����Ϣ.
+ struct rawpkt_metadata *meta_route_dir[2];// ���������metadata, �����ڵ���low_level_sendʱ, ���marsio 4.6����Ҫ����Ϣ.
struct segment_id_list *append_list;
struct segment_id_list *prepend_list;
unsigned long long stream_trace_id;
@@ -186,7 +186,7 @@ struct half_tcpstream
/* ����ÿ�������������һ����, ����polling entry����ʹ�� */
typedef struct {
const raw_pkt_t *raw_pkt_stream_dir[2];
- struct rawpkt_metadata* meta_stream_dir[2];// ÿ������metadata������洢��polling_inject_context��, update_raw_pkt��������ʱ����������䵽���ص�rawpkt��
+ struct rawpkt_metadata* meta_stream_dir[2];// ÿ������metadata��[0:c2s, 1:s2c]����洢��polling_inject_context��, update_raw_pkt��������ʱ����������䵽���ص�rawpkt��
}polling_inject_context_t;
struct streaminfo_private
diff --git a/src/packet_io/packet_io_marsio.c b/src/packet_io/packet_io_marsio.c
index b7169c6..26a5027 100644
--- a/src/packet_io/packet_io_marsio.c
+++ b/src/packet_io/packet_io_marsio.c
@@ -525,19 +525,19 @@ int marsio_send_ctrl_data(unsigned char *data,int datalen, struct segment_id_lis
void marsio_dl_io_set_rawpkt_meta(const raw_pkt_t *raw_pkt, void *send_pkt_io_reference, unsigned char route_dir)
{
- if(raw_pkt->meta[0]== NULL && (raw_pkt->meta[1]== NULL))
+ if(raw_pkt->meta_route_dir[0]== NULL && (raw_pkt->meta_route_dir[1]== NULL))
{
return ;
}
struct rawpkt_metadata *snd_meta = NULL;
- if(raw_pkt->meta[route_dir]!=NULL)
+ if(raw_pkt->meta_route_dir[route_dir]!=NULL)
{
- snd_meta=raw_pkt->meta[route_dir];
+ snd_meta=raw_pkt->meta_route_dir[route_dir];
}
else // failover
{
- snd_meta=raw_pkt->meta[route_dir^1];
+ snd_meta=raw_pkt->meta_route_dir[route_dir^1];
}
if(ptr_marsio_buff_set_metadata)
{
@@ -791,8 +791,8 @@ static inline int marsio4_pkt_hand(int tid, marsio_buff_t *rx_buff, raw_pkt_t *r
raw_pkt->stream_trace_id=0;
raw_pkt->prepend_list=NULL;
raw_pkt->append_list=NULL;
- raw_pkt->meta[0]=NULL;
- raw_pkt->meta[1]=NULL;
+ raw_pkt->meta_route_dir[0]=NULL;
+ raw_pkt->meta_route_dir[1]=NULL;
ret = (*g_marsio4_work_fun)((const raw_pkt_t *)raw_pkt, dir, tid);
diff --git a/src/packet_io/sendpacket.c b/src/packet_io/sendpacket.c
index 8abda7c..cc89b09 100644
--- a/src/packet_io/sendpacket.c
+++ b/src/packet_io/sendpacket.c
@@ -2522,8 +2522,22 @@ static raw_pkt_t *update_raw_pkt(struct streaminfo_private *stream_pr, uchar snd
if (stream_pr->polling_inject_context != NULL)
{
- inject_raw_pkt->meta[0]=stream_pr->polling_inject_context->meta_stream_dir[0];
- inject_raw_pkt->meta[1]=stream_pr->polling_inject_context->meta_stream_dir[1];
+ inject_raw_pkt->meta_route_dir[stream_pr->stream_c2s_route_dir]=stream_pr->polling_inject_context->meta_stream_dir[DIR_C2S-1];
+ inject_raw_pkt->meta_route_dir[stream_pr->stream_c2s_route_dir^1]=stream_pr->polling_inject_context->meta_stream_dir[DIR_S2C-1];
+
+#if 0
+ if(snd_dir==stream_pr->stream_c2s_route_dir)
+ {
+ inject_raw_pkt->meta_route_dir[snd_dir]=stream_pr->polling_inject_context->meta_stream_dir[DIR_C2S-1];
+ inject_raw_pkt->meta_route_dir[snd_dir^1]=stream_pr->polling_inject_context->meta_stream_dir[DIR_S2C-1];
+ }
+ else
+ {
+ inject_raw_pkt->meta_route_dir[snd_dir]=stream_pr->polling_inject_context->meta_stream_dir[DIR_S2C-1];
+ inject_raw_pkt->meta_route_dir[snd_dir^1]=stream_pr->polling_inject_context->meta_stream_dir[DIR_C2S-1];
+
+ }
+#endif
}
return inject_raw_pkt;