patch-2.1.92 linux/fs/ncpfs/ncplib_kernel.c
Next file: linux/fs/ncpfs/ncpsign_kernel.c
Previous file: linux/fs/ext2/ioctl.c
Back to the patch index
Back to the overall index
- Lines: 22
- Date:
Mon Mar 30 16:40:37 1998
- Orig file:
v2.1.91/linux/fs/ncpfs/ncplib_kernel.c
- Orig date:
Tue Mar 10 10:03:34 1998
diff -u --recursive --new-file v2.1.91/linux/fs/ncpfs/ncplib_kernel.c linux/fs/ncpfs/ncplib_kernel.c
@@ -147,6 +147,9 @@
int size, int options, int *ret_size, int *ret_options) {
int result;
+ /* there is minimum */
+ if (size < 512) size = 512;
+
ncp_init_request(server);
ncp_add_word(server, htons(size));
ncp_add_byte(server, options);
@@ -157,7 +160,10 @@
return result;
}
- *ret_size = min(ntohs(ncp_reply_word(server, 0)), size);
+ /* NCP over UDP returns 0 (!!!) */
+ result = ntohs(ncp_reply_word(server, 0));
+ if (result >= 512) size=min(result, size);
+ *ret_size = size;
*ret_options = ncp_reply_byte(server, 4);
ncp_unlock_server(server);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov