summaryrefslogtreecommitdiffstats
path: root/lib/libncp/sap.c
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>1999-10-29 12:59:59 +0000
committerbp <bp@FreeBSD.org>1999-10-29 12:59:59 +0000
commit61d5a0b6ee78a877fec0d4ce1ab50f7e1a1f6e1f (patch)
tree7561ded68590332c08c1732c081fd5ce65ca3720 /lib/libncp/sap.c
parentc3fe19695c2383a01f060675157103ec369cb11e (diff)
downloadFreeBSD-src-61d5a0b6ee78a877fec0d4ce1ab50f7e1a1f6e1f.zip
FreeBSD-src-61d5a0b6ee78a877fec0d4ce1ab50f7e1a1f6e1f.tar.gz
Handle SAP responces in a more correct way. Allow connection number
greater than 255 in the broadcast messages.
Diffstat (limited to 'lib/libncp/sap.c')
-rw-r--r--lib/libncp/sap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libncp/sap.c b/lib/libncp/sap.c
index 32e0ab2..78531ab 100644
--- a/lib/libncp/sap.c
+++ b/lib/libncp/sap.c
@@ -280,12 +280,12 @@ sap_find_nearest(int server_type, struct sockaddr_ipx *daddr, char *server_name)
packets = 5;
do {
len = sap_recv(sock, data, sizeof(data), 0, 1);
- if (len < 66) {
- packets++;
- continue;
- }
- } while (ntohs(reply->operation) != IPX_SAP_NEAREST_RESPONSE &&
- packets > 0);
+ if (len >= 66 &&
+ ntohs(reply->operation) == IPX_SAP_NEAREST_RESPONSE)
+ break;
+ if (len < 0)
+ packets--;
+ } while (packets > 0);
if (packets == 0) {
close(sock);
OpenPOWER on IntegriCloud