summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2023-04-06 18:52:30 +0800
committer杨威 <[email protected]>2023-04-06 18:52:30 +0800
commit1d2719f907e1e48b6f5b60ed9117dc026e03b163 (patch)
tree6e841425ee23de9d094b1f67f9e62ec312ded492
parent5be16ff7d1131c5f75d64059fc2a7412c18f42d5 (diff)
🐞 fix(stream manager): 调整追加sid逻辑,避免转发到service chain上引起其他SF的歧义
对于kill remedy,drop stream和重复流量,sapp直接处理,不再追加流上的sid,避免转发到service chain上引起其他SF的歧义
-rw-r--r--src/dealpkt/deal_tcp.c28
-rw-r--r--src/dealpkt/deal_udp.c17
2 files changed, 26 insertions, 19 deletions
diff --git a/src/dealpkt/deal_tcp.c b/src/dealpkt/deal_tcp.c
index 892f435..4b9a80e 100644
--- a/src/dealpkt/deal_tcp.c
+++ b/src/dealpkt/deal_tcp.c
@@ -2894,19 +2894,7 @@ static int deal_tcp_stream(struct streamindex *pindex, const void *this_iphdr, s
}
- if(pstream_pr->sid_append_list != NULL)
- {
- ((raw_pkt_t *)raw_pkt)->append_list=pstream_pr->sid_append_list;
- }
- if(pstream_pr->sid_prepend_list != NULL)
- {
- ((raw_pkt_t *)raw_pkt)->prepend_list=pstream_pr->sid_prepend_list;
- }
- if(pstream_pr->stream_trace_id != 0)
- {
- ((raw_pkt_t *)raw_pkt)->stream_trace_id=pstream_pr->stream_trace_id;
- }
/* 2014-10-11 lijia add, Fd������ƽ̨ʵ�� */
if(unlikely(pstream_pr->stream_killed_flag != 0)){
@@ -2949,6 +2937,22 @@ static int deal_tcp_stream(struct streamindex *pindex, const void *this_iphdr, s
return DROP;
}
+// ����kill remedy��drop stream���ظ�������sappֱ�Ӵ���������׷�����ϵ�sid,����ת����service chain����������SF������
+ if(pstream_pr->sid_append_list != NULL)
+ {
+ ((raw_pkt_t *)raw_pkt)->append_list=pstream_pr->sid_append_list;
+ }
+ if(pstream_pr->sid_prepend_list != NULL)
+ {
+ ((raw_pkt_t *)raw_pkt)->prepend_list=pstream_pr->sid_prepend_list;
+ }
+
+ if(pstream_pr->stream_trace_id != 0)
+ {
+ ((raw_pkt_t *)raw_pkt)->stream_trace_id=pstream_pr->stream_trace_id;
+ }
+
+
if(pstream->curdir==DIR_S2C)
{
if(pdetail->clientpktnum == 0) /* ��ǰ����ĵ�һ����, ���Ը��µײ������ĵ����ַ��Ϣ(��MPLS, GTP) */
diff --git a/src/dealpkt/deal_udp.c b/src/dealpkt/deal_udp.c
index 86d0b70..1c6f92c 100644
--- a/src/dealpkt/deal_udp.c
+++ b/src/dealpkt/deal_udp.c
@@ -654,6 +654,16 @@ int dealipv4udppkt(struct streamindex *pindex, const struct mesa_ip4_hdr * this_
return PASS;
}
+ /* 2014-11-15 lijia add, for udp serial kill udp */
+ if(unlikely(a_index->stream.stream_killed_flag != 0)){
+ return DROP;
+ }
+
+ if(unlikely(pdetail_pr->drop_stream_flag != 0)){ /* 2020-06-02 lijia add */
+ return DROP;
+ }
+
+ // ����kill remedy��drop stream���ظ�������sappֱ�Ӵ���������׷�����ϵ�sid,����ת����service chain����������SF������
if (pstream_pr->sid_append_list != NULL)
{
((raw_pkt_t *)raw_pkt)->append_list = pstream_pr->sid_append_list;
@@ -667,14 +677,7 @@ int dealipv4udppkt(struct streamindex *pindex, const struct mesa_ip4_hdr * this_
((raw_pkt_t *)raw_pkt)->stream_trace_id = pstream_pr->stream_trace_id;
}
- /* 2014-11-15 lijia add, for udp serial kill udp */
- if(unlikely(a_index->stream.stream_killed_flag != 0)){
- return DROP;
- }
- if(unlikely(pdetail_pr->drop_stream_flag != 0)){ /* 2020-06-02 lijia add */
- return DROP;
- }
if(pstream->curdir==DIR_S2C){
if(pdetail_pr->udpdetail_public.clientpktnum == 0){ /* ��ǰ����ĵ�һ����, ���Ը��µײ������ĵ����ַ��Ϣ(��MPLS, GTP) */