iputils: patch working_recverr
This commit is contained in:
parent
72fd74bf94
commit
8a8d576b24
|
@ -0,0 +1,42 @@
|
||||||
|
diff -Naur iputils-s20121221.orig/ping.c iputils-s20121221/ping.c
|
||||||
|
--- iputils-s20121221.orig/ping.c 2013-12-08 13:41:47.077791445 -0800
|
||||||
|
+++ iputils-s20121221/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)
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'iputils'
|
# Template file for 'iputils'
|
||||||
pkgname=iputils
|
pkgname=iputils
|
||||||
version=20121221
|
version=20121221
|
||||||
revision=9
|
revision=10
|
||||||
build_pie=yes
|
build_pie=yes
|
||||||
patch_args="-Np1"
|
patch_args="-Np1"
|
||||||
wrksrc="${pkgname}-s${version}"
|
wrksrc="${pkgname}-s${version}"
|
||||||
|
|
Loading…
Reference in New Issue