diff packet.c @ 568:005530560594

Rearrange getaddrstring() etc
author Matt Johnston <matt@ucc.asn.au>
date Tue, 01 Sep 2009 16:38:26 +0000
parents ccdc4c6183c0
children afb089e70892
line wrap: on
line diff
--- a/packet.c	Mon Aug 31 15:25:39 2009 +0000
+++ b/packet.c	Tue Sep 01 16:38:26 2009 +0000
@@ -157,9 +157,10 @@
 static int read_packet_init() {
 
 	unsigned int maxlen;
-	int len;
-	unsigned char blocksize;
-	unsigned char macsize;
+	int slen;
+	unsigned int len;
+	unsigned int blocksize;
+	unsigned int macsize;
 
 
 	blocksize = ses.keys->recv.algo_crypt->blocksize;
@@ -173,12 +174,12 @@
 	maxlen = blocksize - ses.readbuf->pos;
 			
 	/* read the rest of the packet if possible */
-	len = read(ses.sock_in, buf_getwriteptr(ses.readbuf, maxlen),
+	slen = read(ses.sock_in, buf_getwriteptr(ses.readbuf, maxlen),
 			maxlen);
-	if (len == 0) {
+	if (slen == 0) {
 		ses.remoteclosed();
 	}
-	if (len < 0) {
+	if (slen < 0) {
 		if (errno == EINTR) {
 			TRACE(("leave read_packet_init: EINTR"))
 			return DROPBEAR_FAILURE;
@@ -186,9 +187,9 @@
 		dropbear_exit("error reading: %s", strerror(errno));
 	}
 
-	buf_incrwritepos(ses.readbuf, len);
+	buf_incrwritepos(ses.readbuf, slen);
 
-	if ((unsigned int)len != maxlen) {
+	if ((unsigned int)slen != maxlen) {
 		/* don't have enough bytes to determine length, get next time */
 		return DROPBEAR_FAILURE;
 	}