Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fping incompatibility with Freebsd oses #39

Closed
ghost opened this issue Feb 23, 2013 · 5 comments
Closed

Fping incompatibility with Freebsd oses #39

ghost opened this issue Feb 23, 2013 · 5 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 23, 2013

Different tests using Fping 3.4 (port or manually source compiled) on freebsd (9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825)

Scenario : the host we want to fping is not alive

A) Cases
case 1) :
fping ip_hostdown when ip_hostdown is not located on local network :
result is ALWAYS = ip_hostdown is unreachable

case 2)
fping ip_hostdown when ip_hostdown is located on local network :

result is very rarely = ip_hostdown is unreachable

result is almost always (mainly if i give consecutive tries):
ip_hostdown error while sending ping: Host is down

ip_hostdown error while sending ping: Host is down

ip_hostdown error while sending ping: Host is down

ip_hostdown error while sending ping: Host is down

ip_hostdown error while sending ping: Host is down

ip_hostdown error while sending ping: Host is down

ip_hostdown error while sending ping: Host is down

......
......

==> fping get stuck and never stop if i don't ctrc-c
When i ctrl-c to stop stucked fping ==> ^Cip_hostdown is unreachable

B) source code fping 3.4 : "error while sending ping" is in source code fping.c line 1581
"Host is down" doesn't come from fping source code.

C) Linux test (many version of kernel/distribution) with compiled version of fping 3.4
result is always : ip_hostdown is unreachable
@ghost
Copy link
Author

ghost commented Feb 24, 2013

I have completed those tests with different versions of FreeBSD in different networks architectures (with/without vlans,vrrp...). Chatting at Freenode #Zabbix channel other user using FreeBSD have reproduced the same issue.

@ghost
Copy link
Author

ghost commented Feb 26, 2013

Clarification on the procedure to reproduce the problem :

First of all, the goal is to use fping command to check an unreachable host_ip availability (this host must be DOWN) LOCATED ON THE LOCAL NETWORK, same subnet (your FreeBSD has an interface and
an IP in this network).

(ps : Using fping with ip located on external/routed network, fping always
works normally, without any error)

Then you have to launch this command 2 or 3 consecutive times from
your box using the SAME non responsive IP (very important, you have to
make the test with the same IP and as soon command is finished start
again 2 or 3 times):

Fping free_ip_address
Fping free_ip_address (do not change ip)
Fping free_ip_adress (do not change ip)

If you follow this procedure you will get something like:

fping 10.0.5.81 ==> 10.0.5.81 is unreachable
fping 10.0.5.81 ==> 10.0.5.81 error while sending ping: Host is down
10.0.5.81 error while sending ping: Host is down
10.0.5.81 error while sending ping: Host is down
10.0.5.81 error while sending ping: Host is down
10.0.5.81 error while sending ping: Host is down
10.0.5.81 error while sending ping: Host is down
10.0.5.81 error while sending ping: Host is down
10.0.5.81 error while sending ping: Host is down

Then pfing will get stuck and if you ctrl-c, it will stop and you will
get the normal fping output : ^C10.0.5.81 is unreachable

The first try will be ok with a normal result, as soon as you will
make a second try you will see the errors.

@ghost
Copy link
Author

ghost commented Feb 26, 2013

FreeBSD Fping port maintainer have confirmed this issue.

A suggestion would be a negative caching issue that fping doesn't handle.

@ghost
Copy link
Author

ghost commented Feb 27, 2013

FreeBSD Problem Report :
http://www.freebsd.org/cgi/query-pr.cgi?pr=176439

@ghost
Copy link
Author

ghost commented Apr 5, 2013

A patch has been submitted by FreeBSD Fping port maintainer (refer http://www.freebsd.org/cgi/query-pr.cgi?pr=176439):

diff -r 830ac78f8d7f files/patch-fping.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/files/patch-fping.c Tue Mar 05 08:53:29 2013 -0400
@@ -0,0 +1,16 @@
+diff -r c564b3055165 src/fping.c
+--- src/fping.c Tue Mar 05 08:13:11 2013 -0400
++++ src/fping.c Tue Mar 05 08:45:33 2013 -0400
+@@ -1572,7 +1572,11 @@

  • n = sendto( s, buffer, ping_pkt_size, 0,
  • ( struct sockaddr* )&h->saddr, sizeof( FPING_SOCKADDR ) );
    +
    +- if( n < 0 || n != ping_pkt_size )
    ++ if(( n < 0 || n != ping_pkt_size)
    ++#if defined( EHOSTDOWN )
    ++ && errno != EHOSTDOWN
    ++#endif
    ++ )
  • {
  • if( verbose_flag || unreachable_flag )
  • {
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.12 (FreeBSD)

Can anyone validate and integrate if functional.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant