Skip to content

Commit

Permalink
sk-inet: add extra debugging information to sk-inet
Browse files Browse the repository at this point in the history
Signed-off-by: समीर सिंह Sameer Singh <[email protected]>
  • Loading branch information
ss141309 committed Jan 9, 2025
1 parent f873c3c commit 6f97c64
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions criu/sk-inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 6f97c64

Please sign in to comment.