summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/packet.c b/packet.c
index ba93417317a20..d0c66fe57cb89 100644
--- a/packet.c
+++ b/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 $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -242,7 +242,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;
}
@@ -432,8 +432,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))
@@ -972,8 +970,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;
@@ -1448,12 +1448,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.