diff options
author | bp <bp@FreeBSD.org> | 1999-10-29 12:59:59 +0000 |
---|---|---|
committer | bp <bp@FreeBSD.org> | 1999-10-29 12:59:59 +0000 |
commit | 61d5a0b6ee78a877fec0d4ce1ab50f7e1a1f6e1f (patch) | |
tree | 7561ded68590332c08c1732c081fd5ce65ca3720 /lib/libncp/ncpl_misc.c | |
parent | c3fe19695c2383a01f060675157103ec369cb11e (diff) | |
download | FreeBSD-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/ncpl_misc.c')
-rw-r--r-- | lib/libncp/ncpl_misc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/libncp/ncpl_misc.c b/lib/libncp/ncpl_misc.c index 7f7a67a..f2fa123 100644 --- a/lib/libncp/ncpl_misc.c +++ b/lib/libncp/ncpl_misc.c @@ -131,16 +131,20 @@ NWGetObjectConnectionNumbers(NWCONN_HANDLE connHandle, pnuint16 pNumConns, pnuint16 pConnHandleList, nuint16 maxConns) { - int error, i; + int error, i, n; + nuint32 lastconn; DECLARE_RQ; - ncp_init_request_s(conn, 21); + + lastconn = 0; + ncp_init_request_s(conn, 27); + ncp_add_dword_lh(conn, lastconn); ncp_add_word_hl(conn, objType); ncp_add_pstring(conn, pObjName); if ((error = ncp_request(connHandle, 23, conn)) != 0) return error; - i = ncp_reply_byte(conn,0); - *pNumConns = i; - for (i = min(i, maxConns); i; i--) { - pConnHandleList[i-1] = ncp_reply_byte(conn, i); + n = min(ncp_reply_byte(conn, 0), maxConns); + *pNumConns = n; + for (i = 0; i < n ; i++) { + *pConnHandleList++ = ncp_reply_dword_lh(conn, i * 4 + 1); } return 0; } |