summaryrefslogtreecommitdiffstats
path: root/hunt
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>2002-09-20 17:27:57 +0000
committermycroft <mycroft@NetBSD.org>2002-09-20 17:27:57 +0000
commite05b1c0de535fc268d8d5ccb5f1d3d9c0f6d0d42 (patch)
tree22cd53f775494923949d34756163e1c0d810a38e /hunt
parent5395af2c00ffe8b4a251932ea65bec2b4b185d8c (diff)
downloadbsdgames-darwin-e05b1c0de535fc268d8d5ccb5f1d3d9c0f6d0d42.tar.gz
bsdgames-darwin-e05b1c0de535fc268d8d5ccb5f1d3d9c0f6d0d42.tar.zst
bsdgames-darwin-e05b1c0de535fc268d8d5ccb5f1d3d9c0f6d0d42.zip
If we're searching for a huntd, probe local_address along with broadcast
addresses.
Diffstat (limited to 'hunt')
-rw-r--r--hunt/hunt/hunt.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c
index 9034b27f..9e13c44a 100644
--- a/hunt/hunt/hunt.c
+++ b/hunt/hunt/hunt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hunt.c,v 1.13 2002/09/20 15:47:19 mycroft Exp $ */
+/* $NetBSD: hunt.c,v 1.14 2002/09/20 17:27:57 mycroft Exp $ */
/*
* Hunt
* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
@@ -7,7 +7,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hunt.c,v 1.13 2002/09/20 15:47:19 mycroft Exp $");
+__RCSID("$NetBSD: hunt.c,v 1.14 2002/09/20 17:27:57 mycroft Exp $");
#endif /* not lint */
# include <sys/param.h>
@@ -452,12 +452,6 @@ list_drivers()
if (initial)
brdc = broadcast_vec(test_socket, (struct sockaddr **) &brdv);
- if (brdc <= 0) {
- initial = FALSE;
- test.sin_addr = local_address;
- goto test_one_host;
- }
-
# ifdef SO_BROADCAST
/* Sun's will broadcast even though this option can't be set */
option = 1;
@@ -480,6 +474,13 @@ list_drivers()
/* NOTREACHED */
}
}
+ test.sin_addr = local_address;
+ if (sendto(test_socket, (char *) &msg, sizeof msg, 0,
+ (struct sockaddr *) &test, DAEMON_SIZE) < 0) {
+ warn("sendto");
+ leave(1, "sendto");
+ /* NOTREACHED */
+ }
# else /* !BROADCAST */
/* loop thru all hosts on local net and send msg to them. */
msg = htons(C_TESTMSG());