1 Star 0 Fork 22

张强/tcpdump_Euler

forked from src-openEuler/tcpdump 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0090-Set-SA_RESTART-non-lethal-signals-avoid-corrupting-binary-pcap-output.patch 840 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 8a28e07f3bfd2a031491db55173370e10dc074e3 Mon Sep 17 00:00:00 2001
From: Alexandre Ferrieux <alexandre.ferrieux@orange.com>
Date: Sat, 16 Jul 2022 21:34:39 +0200
Subject: [PATCH] Set SA_RESTART on non-lethal signals (REQ_INFO, FLUSH_PCAP)
to avoid corrupting binary pcap output
---
tcpdump.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tcpdump.c b/tcpdump.c
index e028d2e7..515edf5d 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -2743,7 +2743,14 @@ static void
memset(&new, 0, sizeof(new));
new.sa_handler = func;
- if (sig == SIGCHLD)
+ if ((sig == SIGCHLD)
+# ifdef SIGNAL_REQ_INFO
+ || (sig == SIGNAL_REQ_INFO)
+# endif
+# ifdef SIGNAL_FLUSH_PCAP
+ || (sig == SIGNAL_FLUSH_PCAP)
+# endif
+ )
new.sa_flags = SA_RESTART;
if (sigaction(sig, &new, &old) < 0)
return (SIG_ERR);
--
2.25.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kylinos-zhangqiang/tcpdump_Euler.git
git@gitee.com:kylinos-zhangqiang/tcpdump_Euler.git
kylinos-zhangqiang
tcpdump_Euler
tcpdump_Euler
master

搜索帮助