summaryrefslogtreecommitdiffhomepage
path: root/networking/ping.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 23:22:06 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 23:22:06 +0000
commit48237b0c88343154d58854020c3a9c8b07c61b10 (patch)
treeb36bc84f22dd797b45c8d665e50e2f6c690e1370 /networking/ping.c
parentb40bdb383a6b7a7f0fd36d0b1cc24deb42cd5f0d (diff)
introduce setsockopt_reuseaddr(int fd), setsockopt_broadcast(int fd),
use them where appropriate. 200 bytes saved
Diffstat (limited to 'networking/ping.c')
-rw-r--r--networking/ping.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/networking/ping.c b/networking/ping.c
index 400d565d9..fc01b5e1d 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -351,9 +351,7 @@ static void ping(const char *host)
memcpy(&pingaddr.sin_addr, hostent->h_addr, sizeof(pingaddr.sin_addr));
/* enable broadcast pings */
- sockopt = 1;
- setsockopt(pingsock, SOL_SOCKET, SO_BROADCAST, (char *) &sockopt,
- sizeof(sockopt));
+ setsockopt_broadcast(pingsock);
/* set recv buf for broadcast pings */
sockopt = 48 * 1024;