search for: packet_connection_is_on_socket

Displaying 20 results from an estimated 22 matches for "packet_connection_is_on_socket".

2001 Aug 07
1
do_pre_login() used before declared
...ssion *s) +{ + socklen_t fromlen; + struct sockaddr_storage from; + pid_t pid = getpid(); + + /* + * Get IP address of client. If the connection is not a socket, let + * the address be 0.0.0.0. + */ + memset(&from, 0, sizeof(from)); + if (packet_connection_is_on_socket()) { + fromlen = sizeof(from); + if (getpeername(packet_get_connection_in(), + (struct sockaddr *) & from, &fromlen) < 0) { + debug("getpeername: %.100s", strerror(errno)); + fatal_cleanu...
2003 Jun 16
1
[Bug 594] SSH tries to set nodelay on non-sockets
...at.com getsockopt TCP_NODELAY: Socket operation on non-socket Then things work normally. The problem seems to be that a "return;" has been deleted from the function "packet_set_interactive" in packet.c. The code reads: /* Only set socket options if using a socket. */ if (!packet_connection_is_on_socket()) if (interactive) set_nodelay(connection_in); The odd indentation suggests that something has gone wrong. The logic doens't make any sense, either: if the connection is not on a socket, then one shouldn't try to set socket options on it. Finally, in 3.4p1, the code reads: /* Only...
2003 Apr 09
1
[Bug 541] packet_set_interactive typo
...ReportedBy: furrier at iglou.com Hi, In OpenSSH 3.6.1p1, the function packet_set_interactive() in packet.c appears to have changed from 3.5p1. It appears there may be a typographical error. Specifically, 3.6.1p1 shows: /* Only set socket options if using a socket. */ if (!packet_connection_is_on_socket()) if (interactive) set_nodelay(connection_in); when it is probably supposed to say: /* Only set socket options if using a socket. */ if (!packet_connection_is_on_socket()) return; if (interactive) set_nodelay(connectio...
2014 Jul 16
1
ssh - Connection closed by UNKNOWN
Hi, ssh clients shows "closed by UNKNOWN" message when a socket is closed by a remote side while ssh is waiting for user's password: $ ssh user at localhost user at localhost's password: Connection closed by UNKNOWN When the packet_read_seqnr() calls get_remote_ipaddr(), a connection's socket is already closed and there's not been any other call of this function yet
2012 Jan 10
1
Configuration file TCPKeepAlive option does not work reliably
Hi! There are configuration knobs (TCPKeepAlive) to enable/disable the use of TCP keepalives both in the ssh client and server. Unfortunately some UNIX systems default to SO_KEEPALIVE=on and some to =off. This may even be settable on a per host basis (OpenBSD default net.inet.tcp.always_keepalive=1 ???). For the TCPKeepAlive configuration knob I would like to propose changes along the lines
2001 Mar 22
0
Solaris UseLogin problem
...al("do_exec_pty: no session"); @@ -635,11 +637,35 @@ /* Close the extra descriptor for the pseudo tty. */ close(ttyfd); + + /* + * Get IP address of client. If the connection is not a socket, let + * the address be 0.0.0.0. + */ + memset(&from, 0, sizeof(from)); + if (packet_connection_is_on_socket()) { + fromlen = sizeof(from); + if (getpeername(packet_get_connection_in(), + (struct sockaddr *) & from, &fromlen) < 0) { + debug("getpeername: %.100s", strerror(errno)); + fatal_cleanup(); + } + } - /* record login, etc. similar to login(1) */ - if (!...
2011 Apr 15
12
[Bug 1889] New: bug in packet.c sometimes cause segfault
...latform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: sshd AssignedTo: unassigned-bugs at mindrot.org ReportedBy: jchadima at redhat.com There is an assumption that active_state is assigned before calling packet_connection_is_on_socket. Sometimes (early crashes) it is not true. -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
2001 Oct 13
0
local IP in environment
...2001 *************** *** 255,260 **** --- 255,281 ---- return get_socket_address(socket, 0, NI_NAMEREQD); } + const char * + get_local_ipaddr2(void) + { + static char *canonical_host_ip = NULL; + + /* Check whether we have cached the ipaddr. */ + if (canonical_host_ip == NULL) { + if (packet_connection_is_on_socket()) { + canonical_host_ip = + get_local_ipaddr(packet_get_connection_out()); + if (canonical_host_ip == NULL) + fatal_cleanup(); + } else { + /* If not on socket, return UNKNOWN. */ + canonical_host_ip = xstrdup("UNKNOWN"); + } + } + return canonical_host_ip; +...
2003 Apr 03
0
minor cosmetic fix hwen using a proxy
...ot;TCP_NODELAY on a non-socket" bug. Nobuo Sakiyama <nobuo at isl.rdc.toshiba.co.jp> diff -u packet.c.dist packet.c --- packet.c.dist Mon Dec 23 11:42:53 2002 +++ packet.c Thu Apr 3 18:06:12 2003 @@ -1344,6 +1344,7 @@ /* Only set socket options if using a socket. */ if (!packet_connection_is_on_socket()) + return; if (interactive) set_nodelay(connection_in); #if defined(IP_TOS) && !defined(IP_TOS_IS_BROKEN)
2003 May 10
1
OpenSSH_3.6.1p2 getsockopt TCP_NODELAY bogus message on Solaris 8
...trieving revision 3.6.1.2 retrieving revision 3.6.1.2.0.1 diff -pu -r3.6.1.2 -r3.6.1.2.0.1 --- packet.c 2003/04/01 11:43:39 3.6.1.2 +++ packet.c 2003/05/10 21:45:22 3.6.1.2.0.1 @@ -1344,6 +1344,7 @@ packet_set_interactive(int interactive) /* Only set socket options if using a socket. */ if (!packet_connection_is_on_socket()) + return; if (interactive) set_nodelay(connection_in); #if defined(IP_TOS) && !defined(IP_TOS_IS_BROKEN)
2006 May 15
1
Problems with proxy connections
...xy connections. It would just hang because the tcp window size that we get when a channel is created was returning 0. That set the internal receive buffer to 0 which just hung up everything. I was able to get around the problem by explicitly testing to see if the connection was on a socket with packet_connection_is_on_socket. If its false then I return an arbitrary value (in this case 128k). Otherwise I return the window size. I don't like this solution though because, even though I know it works, I don't know enough to know if its working in the right way. So the question is, what is this connection type...
2003 May 09
2
TCP_NODELAY always set, now?
I know that there was a discussion on this about a year back, and there is a bug 556 this week that mentions TCP_NODELAY. However, when I use ssh through a pipe (e.g., to tunnel through an HTTP proxy using CONNECT) I see: getsockopt TCP_NODELAY: Socket operation on non-socket How do I tell which end is generating this (I'm assuming the local side, which is running through the pipe). Also,
2009 Nov 23
0
[PATCH] Bluetooth support.
...V4_IN6_HACK_MSG" Index: packet.c =================================================================== RCS file: /cvs/openssh/packet.c,v retrieving revision 1.169 diff -u -p -r1.169 packet.c --- packet.c 2 Oct 2009 01:49:04 -0000 1.169 +++ packet.c 23 Nov 2009 09:50:36 -0000 @@ -308,6 +308,10 @@ packet_connection_is_on_socket(void) return 0; if (fromlen != tolen || memcmp(&from, &to, fromlen) != 0) return 0; +#ifdef HAVE_BLUETOOTH + if (from.ss_family == AF_BLUETOOTH) + return 1; +#endif if (from.ss_family != AF_INET && from.ss_family != AF_INET6) return 0; return 1; -- dwmw2
2002 Dec 29
0
[Bug 460] New: ut_addr_v6 not used
...nssh-3.5p1/session.c openssh-3.5p1/session.c --- t/openssh-3.5p1/session.c 2002-09-26 02:38:50.000000000 +0200 +++ openssh-3.5p1/session.c 2002-11-05 13:11:30.000000000 +0100 @@ -730,8 +730,8 @@ * the address be 0.0.0.0. */ memset(&from, 0, sizeof(from)); + fromlen = sizeof(from); if (packet_connection_is_on_socket()) { - fromlen = sizeof(from); if (getpeername(packet_get_connection_in(), (struct sockaddr *) & from, &fromlen) < 0) { debug("getpeername: %.100s", strerror(errno)); diff -ruN t/openssh-3.5p1/sshlogin.c openssh-3.5p1/sshlogin.c --- t/openssh-3.5p1/sshlogin.c 200...
2001 Jan 12
0
Socket options not properly set for ssh and sshd.
...+1225,7 @@ /* Informs that the current session is interactive. Sets IP flags for that. */ void -packet_set_interactive(int interactive, int keepalives) +packet_set_interactive(int interactive) { int on = 1; @@ -1235,12 +1235,7 @@ /* Only set socket options if using a socket. */ if (!packet_connection_is_on_socket()) return; - if (keepalives) { - /* Set keepalives if requested. */ - if (setsockopt(connection_in, SOL_SOCKET, SO_KEEPALIVE, (void *) &on, - sizeof(on)) < 0) - error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno)); - } + /* * IPTOS_LOWDELAY, TCP_NODELAY and IP...
2000 Mar 25
1
ANNOUNCE: openssh-1.2.3
...ile.c] - remove unused variable 'len'. fix comments. - remove unused variable [log-client.c log-server.c] - rename a cpp symbol, to avoid param.h collision [packet.c] - missing xfree() - getsockname() requires initialized tolen; andy at guildsoftware.com - use getpeername() in packet_connection_is_on_socket(), fixes sshd -i; from Holger.Trapp at Informatik.TU-Chemnitz.DE [pty.c pty.h] - register cleanup for pty earlier. move code for pty-owner handling to pty.c ok provos@, dugsong@ [readconf.c] - turn off x11-fwd for the client, too. [rsa.c] - PKCS#1 padding [scp.c] - allow '....
2000 Mar 25
1
ANNOUNCE: openssh-1.2.3
...ile.c] - remove unused variable 'len'. fix comments. - remove unused variable [log-client.c log-server.c] - rename a cpp symbol, to avoid param.h collision [packet.c] - missing xfree() - getsockname() requires initialized tolen; andy at guildsoftware.com - use getpeername() in packet_connection_is_on_socket(), fixes sshd -i; from Holger.Trapp at Informatik.TU-Chemnitz.DE [pty.c pty.h] - register cleanup for pty earlier. move code for pty-owner handling to pty.c ok provos@, dugsong@ [readconf.c] - turn off x11-fwd for the client, too. [rsa.c] - PKCS#1 padding [scp.c] - allow '....
2001 Apr 29
2
PATCH: UseLogin fix for 2.9p1 (w/improved last-login time)
...} +#ifdef LOGIN_NEEDS_UTMPX +void +do_pre_login(Session *s) +{ + socklen_t fromlen; + struct sockaddr_storage from; + pid_t pid = getpid(); + + /* + * Get IP address of client. If the connection is not a socket, let + * the address be 0.0.0.0. + */ + memset(&from, 0, sizeof(from)); + if (packet_connection_is_on_socket()) { + fromlen = sizeof(from); + if (getpeername(packet_get_connection_in(), + (struct sockaddr *) & from, &fromlen) < 0) { + debug("getpeername: %.100s", strerror(errno)); + fatal_cleanup(); + } + } + + record_utmp_only(pid, s->tty, s->pw->pw_name, +...
2010 Nov 28
2
[PATCH] Use canonical hostname for DNS SSHFP lookup
...ommand, &canohost) != 0) exit(255); if (timeout_ms > 0) @@ -880,7 +881,7 @@ /* Log into the remote system. Never returns if the login fails. */ ssh_login(&sensitive_data, host, (struct sockaddr *)&hostaddr, - pw, timeout_ms); + pw, timeout_ms, canohost); if (packet_connection_is_on_socket()) { verbose("Authenticated to %s ([%s]:%d).", host, @@ -889,6 +890,8 @@ verbose("Authenticated to %s (via proxy).", host); } + xfree (canohost); + /* We no longer need the private host keys. Clear them now. */ if (sensitive_data.nkeys != 0) { for (i = 0; i &lt...
2002 Sep 21
4
OpenSSH -current fails regression on Solaris 8, sshd dumps core
...host as a string. The returned + * string must not be freed. + */ + +const char * +get_local_ipaddr(void) { - return get_socket_address(socket, 0, NI_NUMERICHOST); + static char *canonical_host_ip = NULL; + + /* Check whether we have cached the ipaddr. */ + if (canonical_host_ip == NULL) { + if (packet_connection_is_on_socket()) { + canonical_host_ip = + get_socket_address(packet_get_connection_in(), 0, NI_NUMERICHOST); + if (canonical_host_ip == NULL) + fatal_cleanup(); + } else { + /* If not on socket, return UNKNOWN. */ + canonical_host_ip = xstrdup("UNKNOWN"); + } + } + return canonical_...