Skip to content

Commit

Permalink
zdtm: set net.ipv4.ping_group_range to 58467-58468
Browse files Browse the repository at this point in the history
Set the sysctl variable net.ipv4.ping_group_range to 58467-58468 since
the zdtm test GID is in this range.

Signed-off-by: समीर सिंह Sameer Singh <[email protected]>
  • Loading branch information
ss141309 committed Jan 8, 2025
1 parent 9c54c86 commit f873c3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/zdtm/lib/ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static int prepare_mntns(void)

static int set_ping_group_range(void)
{
// Allow GIDs 40000-50000 to open an unprivileged ICMP socket
if (sysctl_write_str("/proc/sys/net/ipv4/ping_group_range", "40000 50000")) {
// Allow GIDs 58467, 58468 to open an unprivileged ICMP socket
if (sysctl_write_str("/proc/sys/net/ipv4/ping_group_range", "58467 58468")) {
fprintf(stderr, "sysctl_write_str() failed: %m\n");
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions test/zdtm_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ int main(int argc, char **argv)
if (!uid) {
if (create_timens())
exit(1);
// Allow GIDs 40000-50000 to open an unprivileged ICMP socket
if (sysctl_write_str("/proc/sys/net/ipv4/ping_group_range", "40000 50000"))
// Allow GIDs 58467, 58468 to open an unprivileged ICMP socket
if (sysctl_write_str("/proc/sys/net/ipv4/ping_group_range", "58467 58468"))
exit(1);
if (mount(NULL, "/", NULL, MS_REC | MS_SLAVE, NULL)) {
fprintf(stderr, "mount(/, S_REC | MS_SLAVE)): %m");
Expand Down

0 comments on commit f873c3c

Please sign in to comment.