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 ba9341731..d0c66fe57 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.173 2011/05/06 21:14:05 djm Exp $ */ 1/* $OpenBSD: packet.c,v 1.176 2012/01/25 19:40:09 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -242,7 +242,7 @@ packet_set_connection(int fd_in, int fd_out)
242void 242void
243packet_set_timeout(int timeout, int count) 243packet_set_timeout(int timeout, int count)
244{ 244{
245 if (timeout == 0 || count == 0) { 245 if (timeout <= 0 || count <= 0) {
246 active_state->packet_timeout_ms = -1; 246 active_state->packet_timeout_ms = -1;
247 return; 247 return;
248 } 248 }
@@ -432,8 +432,6 @@ packet_connection_af(void)
432 if (getsockname(active_state->connection_out, (struct sockaddr *)&to, 432 if (getsockname(active_state->connection_out, (struct sockaddr *)&to,
433 &tolen) < 0) 433 &tolen) < 0)
434 return 0; 434 return 0;
435 if (to.ss_family == AF_INET)
436 return 1;
437#ifdef IPV4_IN_IPV6 435#ifdef IPV4_IN_IPV6
438 if (to.ss_family == AF_INET6 && 436 if (to.ss_family == AF_INET6 &&
439 IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&to)->sin6_addr)) 437 IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)&to)->sin6_addr))
@@ -972,8 +970,10 @@ packet_send2(void)
972 970
973 /* during rekeying we can only send key exchange messages */ 971 /* during rekeying we can only send key exchange messages */
974 if (active_state->rekeying) { 972 if (active_state->rekeying) {
975 if (!((type >= SSH2_MSG_TRANSPORT_MIN) && 973 if ((type < SSH2_MSG_TRANSPORT_MIN) ||
976 (type <= SSH2_MSG_TRANSPORT_MAX))) { 974 (type > SSH2_MSG_TRANSPORT_MAX) ||
975 (type == SSH2_MSG_SERVICE_REQUEST) ||
976 (type == SSH2_MSG_SERVICE_ACCEPT)) {
977 debug("enqueue packet: %u", type); 977 debug("enqueue packet: %u", type);
978 p = xmalloc(sizeof(*p)); 978 p = xmalloc(sizeof(*p));
979 p->type = type; 979 p->type = type;
@@ -1448,12 +1448,6 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1448 } 1448 }
1449} 1449}
1450 1450
1451int
1452packet_read_poll(void)
1453{
1454 return packet_read_poll_seqnr(NULL);
1455}
1456
1457/* 1451/*
1458 * Buffers the given amount of input characters. This is intended to be used 1452 * Buffers the given amount of input characters. This is intended to be used
1459 * together with packet_read_poll. 1453 * together with packet_read_poll.