search for: ai_addrlen

Displaying 20 results from an estimated 59 matches for "ai_addrlen".

2002 Jan 11
1
rsync 2.5.1 server - strange logs
I've just upgraded my rsync server to 2.5.1 (before, I was using 2.4.6), without changing anything in /etc/rsyncd.conf, and now, I have this logs each time a client connect to server: 2002/01/07 18:33:03 [10432] rsync: reverse name lookup mismatch on fd3 - spoofed address? 2002/01/07 18:33:03 [10432] rsync on admin/sbin/padmin_update.sh from UNKNOWN (172.16.65.14) 2002/01/07 18:33:03 [10432]
2001 Feb 17
2
Important fix (sshd && binding). Portable version only.
...1/sshd.c --- openssh-2.3.0p1.org/sshd.c Sat Jan 6 19:54:11 2001 +++ openssh-2.3.0p1/sshd.c Sat Jan 6 19:55:48 2001 @@ -782,10 +782,10 @@ debug("Bind to port %s on %s.", strport, ntop); /* Bind the socket to the desired port. */ - if ((bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) && - (!ai->ai_next)) { - error("Bind to port %s on %s failed: %.200s.", - strport, ntop, strerror(errno)); + if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) { + if (!ai->ai_next) + error("Bind to port %s on %s failed:...
2000 Jun 06
0
connection timeout
...each one in sequence until the connection succeeds. */ for (ai = aitop; ai; ai = ai->ai_next) { + fd_set ourset; + struct timeval timeout; + if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) continue; if (getnameinfo(ai->ai_addr, ai->ai_addrlen, @@ -253,7 +258,15 @@ * the remote uid as root. */ temporarily_use_uid(original_real_uid); - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { + fcntl(sock, F_SETFL, O_NONBLOCK); + FD_ZERO(&ourset); + FD_SET(sock, &ourset); + timeout.tv_sec = connection...
2011 Aug 05
4
[Bug 8355] New: Use pointer after freeaddrinfo()
https://bugzilla.samba.org/show_bug.cgi?id=8355 Summary: Use pointer after freeaddrinfo() Product: rsync Version: 3.0.8 Platform: All OS/Version: All Status: NEW Severity: critical Priority: P5 Component: core AssignedTo: wayned at samba.org ReportedBy: andrey at zonov.org
2017 Jan 12
3
proposed change to ssh_connect_direct()
On Sat, Jan 7, 2017 at 2:30 PM, Peter Moody <mindrot at hda3.com> wrote: > so I spent a bit of time looking at this and it seems like the only > way to go, at least if I want to keep it in ssh_connect_direct(), is > to use pthreads. further, it seems like getting that accepted is > something of a long shot: Sorry, pthreads is a non-starter. I would have thought that using
2002 May 22
0
[PATCH] connect() timeout
...ts, + u_short port, int family, int connection_attempts, int connection_timeout, int anonymous, struct passwd *pw, const char *proxy_command) { int gaierr; @@ -323,7 +380,8 @@ * the remote uid as root. */ temporarily_use_uid(pw); - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { + if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, + connection_timeout) >= 0) { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); restore_uid(); --- openssh-3.2.2p1/sshconnect.h.ORIG Wed Oct 10 07:07:45 2001 +++ openss...
2018 Feb 23
6
RFC 8305 Happy Eyeballs in OpenSSH
...Y))) + /* Do not initiate new connections yet */ return 0; - } else if (errno != EINPROGRESS) + if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) { + errno = EAFNOSUPPORT; return -1; - - if (waitrfd(sockfd, timeoutp) == -1) + } + if (getnameinfo(ai->ai_addr, ai->ai_addrlen, + ntop, sizeof(ntop), + strport, sizeof(strport), + NI_NUMERICHOST|NI_NUMERICSERV) != 0) { + oerrno = errno; + error("%s: getnameinfo failed", __func__); + errno = oerrno; return -1; - - /* Completed or failed */ - if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval, &am...
2002 Jan 26
5
[PATCH] Connect timeout
...ts, + u_short port, int family, int connection_attempts, int connection_timeout, int anonymous, struct passwd *pw, const char *proxy_command) { int gaierr; @@ -322,7 +361,8 @@ * the remote uid as root. */ temporarily_use_uid(pw); - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { + if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, + connection_timeout) >= 0) { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); restore_uid(); --- sshconnect.h.OK Wed Oct 10 07:07:45 2001 +++ sshconnect.h Sat Jan 26...
2014 Jun 23
2
ListenAdress Exclusion
I was wondering what everyone's thoughts were on a simpler way to exclude addresses from having listeners on them. I know a lot of people have multiple subnets, especially larger corporations. Some networks are non-route-able, and therefor unsuitable for use with SSH, aside from communication between other servers on the same subnet. Given that we may want to exclude those non-route-able
2001 Nov 17
0
[PATCH] Connect timeout
...ts, + u_short port, int family, int connection_attempts, int connection_timeout, int anonymous, struct passwd *pw, const char *proxy_command) { int gaierr; @@ -322,7 +361,8 @@ * the remote uid as root. */ temporarily_use_uid(pw); - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { + if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, + connection_timeout) >= 0) { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); restore_uid(); --- openssh-3.0.1p1/sshconnect.h.ORIG Sat Nov 17 22:49:09 2001 +++ openss...
2003 Apr 15
0
Connect timeout patch
...nt family, int connection_attempts, + u_short port, int family, int connection_attempts, int connection_timeout, int needpriv, const char *proxy_command) { int gaierr; @@ -300,7 +355,8 @@ /* Any error is already output */ continue; - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { + if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, + connection_timeout) >= 0) { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); break; --- openssh-3.6.1p1/sshconnect.h.ORIG Tue Apr 15 23:06:30 2003 +++ openssh-3.6.1p...
2002 Apr 03
1
[PATCH] connect() timeout
...ts, + u_short port, int family, int connection_attempts, int connection_timeout, int anonymous, struct passwd *pw, const char *proxy_command) { int gaierr; @@ -323,7 +381,8 @@ * the remote uid as root. */ temporarily_use_uid(pw); - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { + if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, + connection_timeout) >= 0) { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); restore_uid(); --- openssh-3.1p1/sshconnect.h.ORIG Wed Oct 10 07:07:45 2001 +++ openssh-...
2002 Oct 17
0
[PATCH] connect() timeout for OpenSSH-3.5p1
...nt family, int connection_attempts, + u_short port, int family, int connection_attempts, int connection_timeout, int needpriv, const char *proxy_command) { int gaierr; @@ -300,7 +355,8 @@ /* Any error is already output */ continue; - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { + if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen, + connection_timeout) >= 0) { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); break; --- openssh-3.5p1/sshconnect.h.ORIG Fri Jun 21 02:41:53 2002 +++ openssh-3.5p1/ss...
2002 Oct 30
1
connect() timeout patch.
...ich * should block fallback to rsh and similar), or did we get at least @@ -299,9 +301,11 @@ if (sock < 0) /* Any error is already output */ continue; - + sigfunc = (int)signal(SIGALRM,(void *) timeout); + alarm(options.time_out); if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { /* Successful connection. */ + alarm(0); memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); break; } else { @@ -924,3 +928,18 @@ } return (found); } + +void +timeout(void) +{ + /* Return to here if we get a time out after so many seconds.*/ + + fprintf(std...
2001 Oct 07
3
socks and misc patch to 2.9.9p2
...*/ sock = rresvport_af(&p, family); +#endif /* SOCKS */ if (sock < 0) error("rresvport: af=%d %.100s", family, strerror(errno)); else @@ -326,7 +329,12 @@ * the remote uid as root. */ temporarily_use_uid(pw); - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { +#if defined(SOCKS) + if (Rconnect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) +#else /* SOCKS */ + if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) +#endif /* SOCKS */ + { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrle...
2002 May 11
4
socks5 support
...*/ sock = rresvport_af(&p, family); +#endif /* SOCKS */ if (sock < 0) error("rresvport: af=%d %.100s", family, strerror(errno)); else @@ -326,7 +329,12 @@ * the remote uid as root. */ temporarily_use_uid(pw); - if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { +#if defined(SOCKS) + if (Rconnect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) +#else /* SOCKS */ + if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) +#endif /* SOCKS */ + { /* Successful connection. */ memcpy(hostaddr, ai->ai_addr, ai->ai_addrle...
2006 Feb 20
1
Improved diagnostics patch
...>ai_protocol ); /* See if there's another address that will work... */ continue; } @@ -385,6 +386,7 @@ /* Now we've got a socket - we need to bind it. */ if (bind(s, resp->ai_addr, resp->ai_addrlen) < 0) { /* Nope, try another */ + rsyserr(FERROR, errno, "bind()" ); close(s); continue; }
2003 Mar 05
0
"rsync --daemon" and IPv4/v6 dual stack
..._protocol); - if (s == -1) - /* See if there's another address that will work... */ - continue; - - setsockopt(s, SOL_SOCKET, SO_REUSEADDR, - (char *)&one, sizeof one); - - /* now we've got a socket - we need to bind it */ - if (bind(s, all_ai->ai_addr, all_ai->ai_addrlen) < 0) { - /* Nope, try another */ - close(s); - continue; - } - - freeaddrinfo(all_ai); - return s; + if (s == -1) + return -1; + + setsockopt(s, SOL_SOCKET, SO_REUSEADDR, + (char *)&one, sizeof one); + + /* now we've got a socket - we need to bind it */ + if (bind(s, re...
2012 Feb 12
0
PATCH: multiple BindAddress
...ions.bind_addresses[i], + ssh_gai_strerror(gaierr)); + if ( i == last_idx){ + close(sock); + return -1; + } else { + error("We have more addresses, trying next address: %s",options.bind_addresses[i+1]); + continue; + } + } + + if (bind(sock, res->ai_addr, res->ai_addrlen) < 0) { + error("bind: %s: %s", options.bind_addresses[i], strerror(errno)); + if ( i == last_idx){ + close(sock); + freeaddrinfo(res); + return -1; + } else { + error("We have more addresses, trying next address: %s",options.bind_addresses[i+1]); + cont...
2003 Oct 08
2
2.5.6: a number of minor issues
...ents with, in most cases, no obvious reason for their presence. Here are patches to fix the printf mistakes and shut the compiler warnings up about the unused arguments. --- OLD/clientname.c Thu Jan 1 00:00:00 1970 +++ NEW/clientname.c Thu Jan 1 00:00:00 1970 @@ -277,8 +277,8 @@ if (ai->ai_addrlen < sizeof(struct sockaddr_in6)) { rprintf(FERROR, - "%s: too short sockaddr_in6; length=%d\n", - fn, ai->ai_addrlen); + "%s: too short sockaddr_in6; length=%lu\n", + fn, (unsigned long int) ai->ai_addrlen); return 1; } --- OLD/generator.c Thu Jan...