From 6f97c6429cb744374b6a1150e80164f0ada7e5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0=20=E0=A4=B8=E0=A4=BF?= =?UTF-8?q?=E0=A4=82=E0=A4=B9=20Sameer=20Singh?= Date: Thu, 9 Jan 2025 13:48:07 +0530 Subject: [PATCH] sk-inet: add extra debugging information to sk-inet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: समीर सिंह Sameer Singh --- criu/sk-inet.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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; }