diff options
Diffstat (limited to 'main/busybox/0004-ping-make-ping-work-without-root-privileges.patch')
-rw-r--r-- | main/busybox/0004-ping-make-ping-work-without-root-privileges.patch | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/main/busybox/0004-ping-make-ping-work-without-root-privileges.patch b/main/busybox/0004-ping-make-ping-work-without-root-privileges.patch index 65e5ae4438..91befa6591 100644 --- a/main/busybox/0004-ping-make-ping-work-without-root-privileges.patch +++ b/main/busybox/0004-ping-make-ping-work-without-root-privileges.patch @@ -1,14 +1,14 @@ -From dc3cf4277f672ed1ce567c6915e28341e7963380 Mon Sep 17 00:00:00 2001 +From 9432235d7dc8d4a2bc9b546e63e52e84b7cad5ce Mon Sep 17 00:00:00 2001 From: Natanael Copa <ncopa@alpinelinux.org> Date: Tue, 29 Mar 2016 18:59:22 +0200 -Subject: [PATCH 04/15] ping: make ping work without root privileges +Subject: [PATCH 04/12] ping: make ping work without root privileges --- networking/ping.c | 103 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 87 insertions(+), 16 deletions(-) diff --git a/networking/ping.c b/networking/ping.c -index cfe6826..e4474ae 100644 +index d0ef7ba62..73e903927 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -155,6 +155,7 @@ enum { @@ -46,7 +46,7 @@ index cfe6826..e4474ae 100644 } xmove_fd(sock, pingsock); -@@ -224,10 +239,12 @@ static void ping4(len_and_sockaddr *lsa) +@@ -226,10 +241,12 @@ static void ping4(len_and_sockaddr *lsa) bb_perror_msg("recvfrom"); continue; } @@ -59,10 +59,10 @@ index cfe6826..e4474ae 100644 - pkt = (struct icmp *) (G.packet + (iphdr->ihl << 2)); /* skip ip hdr */ + pkt = (struct icmp *) (G.packet + (iphdr->ihl << 2)); /* skip ip hdr */ + } else pkt = (struct icmp *) G.packet; + if (pkt->icmp_id != G.myid) + continue; /* not our ping */ if (pkt->icmp_type == ICMP_ECHOREPLY) - break; - } -@@ -619,19 +636,21 @@ static void unpack_tail(int sz, uint32_t *tp, +@@ -627,19 +644,21 @@ static void unpack_tail(int sz, uint32_t *tp, } static void unpack4(char *buf, int sz, struct sockaddr_in *from) { @@ -90,7 +90,7 @@ index cfe6826..e4474ae 100644 if (icmppkt->icmp_id != myid) return; /* not our ping */ -@@ -643,7 +662,7 @@ static void unpack4(char *buf, int sz, struct sockaddr_in *from) +@@ -651,7 +670,7 @@ static void unpack4(char *buf, int sz, struct sockaddr_in *from) tp = (uint32_t *) icmppkt->icmp_data; unpack_tail(sz, tp, inet_ntoa(*(struct in_addr *) &from->sin_addr.s_addr), @@ -99,7 +99,7 @@ index cfe6826..e4474ae 100644 } else if (icmppkt->icmp_type != ICMP_ECHO) { bb_error_msg("warning: got ICMP %d (%s)", icmppkt->icmp_type, -@@ -687,11 +706,31 @@ static void ping4(len_and_sockaddr *lsa) +@@ -695,11 +714,31 @@ static void ping4(len_and_sockaddr *lsa) int sockopt; pingaddr.sin = lsa->u.sin; @@ -132,7 +132,7 @@ index cfe6826..e4474ae 100644 } /* enable broadcast pings */ -@@ -708,6 +747,15 @@ static void ping4(len_and_sockaddr *lsa) +@@ -716,6 +755,15 @@ static void ping4(len_and_sockaddr *lsa) setsockopt_int(pingsock, IPPROTO_IP, IP_MULTICAST_TTL, opt_ttl); } @@ -148,7 +148,7 @@ index cfe6826..e4474ae 100644 signal(SIGINT, print_stats_and_exit); /* start the ping's going ... */ -@@ -741,10 +789,33 @@ static void ping6(len_and_sockaddr *lsa) +@@ -749,10 +797,33 @@ static void ping6(len_and_sockaddr *lsa) char control_buf[CMSG_SPACE(36)]; pingaddr.sin6 = lsa->u.sin6; @@ -183,7 +183,7 @@ index cfe6826..e4474ae 100644 { struct icmp6_filter filt; if (!(option_mask32 & OPT_VERBOSE)) { -@@ -872,7 +943,7 @@ static int common_ping_main(int opt, char **argv) +@@ -880,7 +951,7 @@ static int common_ping_main(int opt, char **argv) if (opt & OPT_p) G.pattern = xstrtou_range(str_p, 16, 0, 255); @@ -193,5 +193,5 @@ index cfe6826..e4474ae 100644 #if ENABLE_PING6 { -- -2.9.1 +2.11.0 |