aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/ping.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/networking/ping.c b/networking/ping.c
index 5def8c335..7cccfbfdc 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -576,8 +576,9 @@ static void ping4(len_and_sockaddr *lsa)
576 /* enable broadcast pings */ 576 /* enable broadcast pings */
577 setsockopt_broadcast(pingsock); 577 setsockopt_broadcast(pingsock);
578 578
579 /* set recv buf for broadcast pings */ 579 /* set recv buf (needed if we can get lots of responses: flood ping,
580 sockopt = 48 * 1024; /* explain why 48k? */ 580 * broadcast ping etc) */
581 sockopt = (datalen * 2) + 7 * 1024; /* giving it a bit of extra room */
581 setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, &sockopt, sizeof(sockopt)); 582 setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, &sockopt, sizeof(sockopt));
582 583
583 signal(SIGINT, print_stats_and_exit); 584 signal(SIGINT, print_stats_and_exit);
@@ -640,8 +641,9 @@ static void ping6(len_and_sockaddr *lsa)
640 /* enable broadcast pings */ 641 /* enable broadcast pings */
641 setsockopt_broadcast(pingsock); 642 setsockopt_broadcast(pingsock);
642 643
643 /* set recv buf for broadcast pings */ 644 /* set recv buf (needed if we can get lots of responses: flood ping,
644 sockopt = 48 * 1024; /* explain why 48k? */ 645 * broadcast ping etc) */
646 sockopt = (datalen * 2) + 7 * 1024; /* giving it a bit of extra room */
645 setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, &sockopt, sizeof(sockopt)); 647 setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, &sockopt, sizeof(sockopt));
646 648
647 sockopt = offsetof(struct icmp6_hdr, icmp6_cksum); 649 sockopt = offsetof(struct icmp6_hdr, icmp6_cksum);