1 Star 0 Fork 35

river/criu

forked from src-openEuler/criu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0051-sk-ignore-the-bind-error-for-icmp-socket.patch 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
river 提交于 2022-04-13 15:05 . criu: backport kinds of features/bugfix
From a7d5401953c548c9479c386b52fffcba6b49c0e3 Mon Sep 17 00:00:00 2001
From: "fu.lin" <fulin10@huawei.com>
Date: Wed, 27 Oct 2021 11:57:43 +0800
Subject: [PATCH 51/72] sk: ignore the bind error for icmp socket
Conflict:NA
Reference:https://gitee.com/src-openeuler/criu/pulls/21
Signed-off-by: fu.lin <fulin10@huawei.com>
---
criu/sk-inet.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/criu/sk-inet.c b/criu/sk-inet.c
index c0251db..96c2d09 100644
--- a/criu/sk-inet.c
+++ b/criu/sk-inet.c
@@ -1160,8 +1160,24 @@ int inet_bind(int sk, struct inet_sk_info *ii)
}
if (bind(sk, (struct sockaddr *)&addr, addr_size) == -1) {
- pr_perror("Can't bind inet socket (id %d)", ii->ie->id);
- return -1;
+ InetSkEntry *ie = ii->ie;
+
+ /*
+ * Sometimes the ping-like program restoration may appear
+ * `bind()` error when it is specified the address. In view
+ * of the principle that we should try our best to restore the
+ * process, and ping-like program works abnormal can tolerate,
+ * just warn here instead of report error.
+ */
+ if (ie->proto == IPPROTO_ICMP || ie->proto == IPPROTO_ICMPV6) {
+ pr_warn("Can't bind inet socket (id %d) proto %s\n",
+ ie->id,
+ ie->proto == IPPROTO_ICMP ?
+ "IPPROTO_ICMP" : "IPPROTO_ICMPV6");
+ } else {
+ pr_perror("Can't bind inet socket (id %d)", ii->ie->id);
+ return -1;
+ }
}
if (rst_freebind) {
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mistyriver/criu.git
git@gitee.com:mistyriver/criu.git
mistyriver
criu
criu
master

搜索帮助