diff options
| author | Boris Popov <bp@FreeBSD.org> | 1999-10-29 12:59:59 +0000 |
|---|---|---|
| committer | Boris Popov <bp@FreeBSD.org> | 1999-10-29 12:59:59 +0000 |
| commit | 4d6357abda01286a0b71bc4a671a8d5c1014a0b7 (patch) | |
| tree | 7561ded68590332c08c1732c081fd5ce65ca3720 /lib/libncp/sap.c | |
| parent | fb9d6e45d13837d33717d8710b58af70809cd086 (diff) | |
Notes
Diffstat (limited to 'lib/libncp/sap.c')
| -rw-r--r-- | lib/libncp/sap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libncp/sap.c b/lib/libncp/sap.c index 32e0ab217111..78531ab05ce1 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); |
