[PATCH] set icmp_code always to 0 even when -p option is used
Felix Schladt
felix.schladt at gmail.com
Mon Jun 5 18:03:37 UTC 2023
---
networking/ping.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/networking/ping.c b/networking/ping.c
index 9805695a1..1c387353f 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -563,7 +563,7 @@ static void sendping4(int junk UNUSED_PARAM)
memset(pkt, G.pattern, datalen + ICMP_MINLEN + 4);
pkt->icmp_type = ICMP_ECHO;
- /*pkt->icmp_code = 0;*/
+ pkt->icmp_code = 0;
pkt->icmp_cksum = 0; /* cksum is calculated with this field set to 0 */
pkt->icmp_seq = htons(G.ntransmitted); /* don't ++ here, it can be a macro */
pkt->icmp_id = myid;
@@ -586,7 +586,7 @@ static void sendping6(int junk UNUSED_PARAM)
memset(pkt, G.pattern, datalen + sizeof(struct icmp6_hdr) + 4);
pkt->icmp6_type = ICMP6_ECHO_REQUEST;
- /*pkt->icmp6_code = 0;*/
+ pkt->icmp6_code = 0;
/*pkt->icmp6_cksum = 0;*/
pkt->icmp6_seq = htons(G.ntransmitted); /* don't ++ here, it can be a macro */
pkt->icmp6_id = myid;
--
2.41.0
More information about the busybox
mailing list