Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ping
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Thu Apr 16, 2015 5:45 pm    Post subject: ping Reply with quote

when I ping an unreachable address ping returns

Code:
WARNING: kernel is not very fresh, upgrade is recommended.
From olorin (192.168.0.5): icmp_seq=2 Destination Host Unreachable


It is true I am using that ancient kernel ... 4.0.0

so what is going on?
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
papahuhn
l33t
l33t


Joined: 06 Sep 2004
Posts: 626

PostPosted: Thu Apr 16, 2015 7:01 pm    Post subject: Reply with quote

This is considered a bug and has been removed in Debian from iputils:

Code:

Remove buggy working_recverr checks per bug#709052
Index: iputils/ping.c
===================================================================
--- iputils.orig/ping.c 2013-12-08 13:41:47.077791445 -0800
+++ iputils/ping.c      2013-12-08 13:43:25.238278205 -0800
@@ -654,17 +654,6 @@

                acknowledge(ntohs(icmph.un.echo.sequence));

-               if (!working_recverr) {
-                       struct icmp_filter filt;
-                       working_recverr = 1;
-                       /* OK, it works. Add stronger filter. */
-                       filt.data = ~((1<<ICMP_SOURCE_QUENCH)|
-                                     (1<<ICMP_REDIRECT)|
-                                     (1<<ICMP_ECHOREPLY));
-                       if (setsockopt(icmp_sock, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt)) == -1)
-                               perror("\rWARNING: setsockopt(ICMP_FILTER)");
-               }
-
                net_errors++;
                nerrors++;
                if (options & F_QUIET)
@@ -820,19 +809,7 @@
                                             icp->type != ICMP_SOURCE_QUENCH);
                                if (error_pkt) {
                                        acknowledge(ntohs(icp1->un.echo.sequence));
-                                       if (working_recverr) {
-                                               return 0;
-                                       } else {
-                                               static int once;
-                                               /* Sigh, IP_RECVERR for raw socket
-                                                * was broken until 2.4.9. So, we ignore
-                                                * the first error and warn on the second.
-                                                */
-                                               if (once++ == 1)
-                                                       fprintf(stderr, "\rWARNING: kernel is not very fresh, upgrade is recommended.\n");
-                                               if (once == 1)
-                                                       return 0;
-                                       }
+                                       return 0;
                                }
                                nerrors+=error_pkt;
                                if (options&F_QUIET)

_________________
Death by snoo-snoo!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum