diff options
Diffstat (limited to 'crypto/openssh/packet.c')
-rw-r--r-- | crypto/openssh/packet.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index 8e8a297..6fee80c 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.173 2011/05/06 21:14:05 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.176 2012/01/25 19:40:09 markus Exp $ */ /* $FreeBSD$ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -246,7 +246,7 @@ packet_set_connection(int fd_in, int fd_out) void packet_set_timeout(int timeout, int count) { - if (timeout == 0 || count == 0) { + if (timeout <= 0 || count <= 0) { active_state->packet_timeout_ms = -1; return; } @@ -436,8 +436,6 @@ packet_connection_af(void) if (getsockname(active_state->connection_out, (struct sockaddr *)&to, &tolen) < 0) return 0; - if (to.ss_family == AF_INET) - return 1; #ifdef IPV4_IN_IPV6 if (to.ss_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&to)->sin6_addr)) @@ -976,8 +974,10 @@ packet_send2(void) /* during rekeying we can only send key exchange messages */ if (active_state->rekeying) { - if (!((type >= SSH2_MSG_TRANSPORT_MIN) && - (type <= SSH2_MSG_TRANSPORT_MAX))) { + if ((type < SSH2_MSG_TRANSPORT_MIN) || + (type > SSH2_MSG_TRANSPORT_MAX) || + (type == SSH2_MSG_SERVICE_REQUEST) || + (type == SSH2_MSG_SERVICE_ACCEPT)) { debug("enqueue packet: %u", type); p = xmalloc(sizeof(*p)); p->type = type; @@ -1269,6 +1269,7 @@ packet_read_poll2(u_int32_t *seqnr_p) cipher_crypt(&active_state->receive_context, cp, buffer_ptr(&active_state->input), block_size); cp = buffer_ptr(&active_state->incoming_packet); + active_state->packlen = get_u32(cp); if (active_state->packlen < 1 + 4 || active_state->packlen > PACKET_MAX_SIZE) { @@ -1452,12 +1453,6 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p) } } -int -packet_read_poll(void) -{ - return packet_read_poll_seqnr(NULL); -} - /* * Buffers the given amount of input characters. This is intended to be used * together with packet_read_poll. |