summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2023-11-20 15:36:28 +0800
committerluwenpeng <[email protected]>2023-11-20 16:56:49 +0800
commitdc305adb3b583e7e2a72bce54820d49cb83b3a8f (patch)
tree12de7e243efc642f5974bf105dd78a7076305c02
parent134d2c82b7ebc2229fac03be721555e37f4db571 (diff)
SCE适配Firewall控制报文变更: Reset All控制报文的mpack->Session ID为0,mbuffer->Payload Offset为0v1.2.3-20231120
-rw-r--r--common/src/control_packet.cpp13
-rw-r--r--platform/src/packet_io.cpp5
2 files changed, 11 insertions, 7 deletions
diff --git a/common/src/control_packet.cpp b/common/src/control_packet.cpp
index e67aa95..eb1109d 100644
--- a/common/src/control_packet.cpp
+++ b/common/src/control_packet.cpp
@@ -69,11 +69,14 @@ int control_packet_parse(struct control_packet *handler, const char *data, size_
goto error_out;
}
handler->session_id = mpack_node_u64(temp);
- if (handler->session_id == 0)
- {
- LOG_ERROR("%s: unexpected control packet: (invalid session_id value) %lu", LOG_TAG_CTRLPKT, handler->session_id);
- goto error_out;
- }
+ /*
+ * reset all session id is zero
+ * if (handler->session_id == 0)
+ * {
+ * LOG_ERROR("%s: unexpected control packet: (invalid session_id value) %lu", LOG_TAG_CTRLPKT, handler->session_id);
+ * goto error_out;
+ * }
+ */
// state
temp = mpack_node_map_cstr(root, "state");
diff --git a/platform/src/packet_io.cpp b/platform/src/packet_io.cpp
index a1effe0..3fb22a4 100644
--- a/platform/src/packet_io.cpp
+++ b/platform/src/packet_io.cpp
@@ -2,6 +2,7 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
+#define __FAVOR_BSD 1
#include <netinet/udp.h>
#include <netinet/ether.h>
@@ -1013,11 +1014,11 @@ static void handle_session_active(struct metadata *meta, struct control_packet *
static void handle_session_resetall(struct metadata *meta, struct control_packet *ctrl_pkt, struct thread_ctx *thread_ctx)
{
- struct thread_metrics *thread_metrics = &thread_ctx->thread_metrics;
+ struct global_metrics *global_metrics = thread_ctx->ref_global_metrics;
struct sce_ctx *sce_ctx = thread_ctx->ref_sce_ctx;
LOG_ERROR("%s: session %lu resetall: notification clears all session tables !!!", LOG_TAG_PKTIO, meta->session_id);
- ATOMIC_ZERO(&(thread_metrics->sf_session.num));
+ ATOMIC_ZERO(&(global_metrics->sf_session.num));
for (int i = 0; i < sce_ctx->nr_worker_threads; i++)
{
struct thread_ctx *temp_ctx = &sce_ctx->work_threads[i];