summaryrefslogtreecommitdiffhomepage
path: root/packet.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2009-09-01 16:38:26 +0000
committerMatt Johnston <matt@ucc.asn.au>2009-09-01 16:38:26 +0000
commitf88bed7a30d4c327b42dcd28ce7642ba74dfe592 (patch)
tree2ed69d42fbba50d167daf6e5142edb0980386d8e /packet.c
parentccd02552ddf0fd0b7bfcc29d8c5eb38dd459c465 (diff)
Rearrange getaddrstring() etc
--HG-- extra : convert_revision : 8a18c4a60aeaec085923d13d98fa0f93c506ceba
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/packet.c b/packet.c
index 9621bbd..ea96c04 100644
--- a/packet.c
+++ b/packet.c
@@ -157,9 +157,10 @@ void read_packet() {
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 @@ static int read_packet_init() {
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 @@ static int read_packet_init() {
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;
}