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 768c6ed..b614cec 100644 --- a/criu/sk-inet.c +++ b/criu/sk-inet.c @@ -1187,8 +1187,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) {