diff --git a/criu/sk-inet.c b/criu/sk-inet.c index 067b171ce0..972533e94b 100644 --- a/criu/sk-inet.c +++ b/criu/sk-inet.c @@ -595,6 +595,7 @@ static int do_dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p, int fa ie.ping_grp_range = buffer; } + pr_perror("dump ping_group_range: %s", ie.ping_grp_range); pr_info("Dumping inet socket at %d\n", p->fd); show_one_inet("Dumping", sk); show_one_inet_img("Dumped", &ie); @@ -911,6 +912,27 @@ static int open_inet_sk(struct file_desc *d, int *new_fd) sk = socket(ie->family, ie->type, ie->proto); if (sk < 0) { + int ret; + gid_t current_gid; + char buffer[16]; + + struct sysctl_req req[] = { + { "net/ipv4/ping_group_range", &buffer, CTL_STR(16) }, + }; + + ret = sysctl_op(req, ARRAY_SIZE(req), CTL_READ, CLONE_NEWNET); + if (ret < 0) { + pr_perror("Failed to read ping group range"); + goto err; + } + + buffer[strlen(buffer)] = '\0'; + + current_gid = getgid(); + + pr_perror("current gid: %d", current_gid); + pr_perror("current ping_group_range: %s", buffer); + pr_perror("restore ping_group_range: %s", ie->ping_grp_range); pr_perror("Can't create inet socket"); return -1; }