brettwooldridge / jnb-ping

Java Non-Blocking Ping (ICMP)
Apache License 2.0
35 stars 6 forks source link

Not working with CentOS7.7 kernel 3.10 #7

Closed pufferbatterie closed 4 years ago

pufferbatterie commented 4 years ago

Im trying to get this lib working on CentOS7.

With the shipped kernel 3.10.0-1062.el7.x86_64 i don't get a response or any errors. With the kernel 4.4.220-1.el7.elrepo.x86_64 (updated via elrepo install kernel-lt) it works fine.

Both setups have the necessary kernel parameter net.ipv4.ping_group_range set to "0 0" running as root.

Not sure if this is a issue of jnb-ping but i am thankful for any hints.

brettwooldridge commented 4 years ago

It is possible that the kernel was compiled without support for it. Or are you running in a container, like LXC?

You might try to check your kernel config options to see if something was excluded.

If these are two different systems, you might check the firewall, as ICMP is blocked by default.

pufferbatterie commented 4 years ago

I am running the app as the root user, no namespaces etc. and there is no firewall in place. The newer kernel with net.ipv4.ping_group_range set to allow it for root works fine.

I did not find any related kernel config paramter which compiles this feature. As far as i understand the sysctl for this is there since 2.6 and also can be set and read on both kernels.

However the config shows not up in the procfs (/proc/sys/net/ipv4/ping_group_range). This should not be a problem since it works on the newer kernel where it is also missing.

Since centos kernel is not easy to obtain i found a slightly older one here where IPPROTO_ICMP is already present in af_inet.c and the the implementation of the parameter seems to be made in sysctl_net_ipv4.c.

If some (extra) config is needed i would kindly suggest listing that fact in the README.

brettwooldridge commented 4 years ago

Note added to README.md.