search for: ai_next

Displaying 20 results from an estimated 53 matches for "ai_next".

Did you mean: pi_next
2017 Mar 06
2
Suspicious code in net_socket.c
Good afternoon! Module - net_socket.c Function - get_known_addresses --------------------------------------------------- struct addrinfo *nai = xzalloc(sizeof *nai); if(ai) ai->ai_next = nai; ai = nai; -------------------------------------------------- For my opinion, possible causes: 1. Lost trails (ai_next) 2. ai_next not initialized 3. Possible segfault during "freeaddrinfo" call in do_outgoing_connections May be I don't understand logic? If no misunderstanding...
2003 May 18
1
OpenSSH -current segfaults on HP-UX+gcc
Hi All. As of last night, sshd now segfaults on HP-UX (11.00, gcc 3.2.2) on startup. I've single-stepped through the code in freeaddrinfo and it's called with a valid *addrinfo, follows ai_next once then for some reason attempts to deref the second pointer which is NULL. Suspecting a compiler/optimization bug I recompiled fake-getaddrinfo.c without optimization but that made no difference. If I change the for loop to "for(;ai != NULL; next = ai ? ai->ai_next : NULL)" then...
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 Feb 17
2
Important fix (sshd && binding). Portable version only.
...n 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: %.200s.", + strport, ntop, str...
2017 Mar 08
1
Suspicious code in net_socket.c
For my opinion, special function not needed, because at first time, oai set to NULL, freeaddrinfo tried to free each ai, until occurance of ai_next == NULL. But it works. Linux, Windows, coordinator with white IP, other nodes behind NAT's (1 or two NAT's, only direct connections allowed). There are some problems with MinGW make, at least - mingw-64 from Fedora 25. 1. No definition for ETH_HLEN and ETHER_TYPE_LEN (fd_device.c) 2. no...
2017 Mar 07
0
Suspicious code in net_socket.c
On Mon, Mar 06, 2017 at 01:00:45PM +0300, Roman S wrote: > Module - net_socket.c > Function - get_known_addresses > --------------------------------------------------- > struct addrinfo *nai = xzalloc(sizeof *nai); > if(ai) > ai->ai_next = nai; > ai = nai; > -------------------------------------------------- > For my opinion, possible causes: > 1. Lost trails (ai_next) > 2. ai_next not initialized > 3. Possible segfault during "freeaddrinfo" call in do_outgoing_connections You are right about 1 and 3....
2006 Feb 20
1
Improved diagnostics patch
Hi, all -- Here's a small patch that gives better diagnostics on the daemon side if it fails to start up due to inability to create or bind the socket. Presently, it gives a log entry indicating that no sockets could be bound, but crucially does *not* have the system error message (i.e. errno) from the failed call, making it difficult or impossible to determine the problem. I do have a
2001 Mar 13
0
[PATCH] openssh 2.5.1p2 TIS authserv support
..._PASSIVE : 0; + + host = strdelim(addr); + service = strdelim(addr); + + if ((gaierr = getaddrinfo(host, service, &hints, &aitop)) != 0) + fatal("bad addr or host: %s (%s)\n", + host ? host : "<NULL>", + gai_strerror(gaierr)); + for (ai = aitop; ai->ai_next; ai = ai->ai_next) + ; + ai->ai_next = options->authserv_addrs; + options->authserv_addrs = aitop; + +} +#endif + /* * add listen address */ @@ -551,6 +588,12 @@ case sChallengeResponseAuthentication: intptr = &options->challenge_reponse_authentication; goto pars...
2008 Jul 16
3
openssh 5.0p1: Solaris - Failed to allocate internet-domain X11 display socket.
...:36:51 markus Exp $ */ /* * Author: Tatu Ylonen <ylo at cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland *************** *** 2905,2913 **** debug2("bind port %d: %.100s", port, strerror(errno)); close(sock); - if (ai->ai_next) - continue; - for (n = 0; n < num_socks; n++) { close(socks[n]); } --- 2906,2911 ---- When those two lines are added back in, X11 forwarding is able to get a port bound. This is only the case on Solaris. On Linux, *BSD, IRIX systems the current code works. Thanks f...
2007 Jan 23
2
Re: [nut-commits] svn commit r731
...ddrinfo (host, service, &hints, &r) != 0) { > + if (getaddrinfo(host, sport, &hints, &res) != 0) > + { > ups->upserror = UPSCLI_ERR_NOSUCHHOST; > - free (service); > return -1; > } > - free (service); > > - for (rtmp = r; r != NULL; r = r->ai_next) { > - ups->fd = socket (r->ai_family, r->ai_socktype, r->ai_protocol); > - if (ups->fd < 0) { > - if (r->ai_next == NULL) { > + for (ai = res; ai != NULL; ai = ai->ai_next) > + { > + int sock_fd, v; > + > + if (ai->ai_socktype != hints.ai_so...
2010 May 24
3
5.2: Solaris 10 x86 x-11 forwarding fails, assign requested address
...[X11 inet listener] debug1: server_input_channel_req: channel 0 request exec reply 1 Looking at differences between the 4.7 and 5.2 ( 5.5 is the same in this regards ), the difference seems to be in: channels.c Function: x11_create_display_inet Line:2908: ( 4.7p1 code ) if (ai->ai_next) continue; That's right after the bind fails. If I follow the behavior, the first ai from getaddrinfo is an IPV6 address that's not valid. Errno is EADDRNOTAVAIL. Now in 4.7 the continue would make it just try the next ai. In 5.2 that continue isn't there, so inste...
2007 Jan 06
3
Re: [nut-commits] svn commit r708 - in trunk: . clients server
...); > > - if (connect(ups->fd, (struct sockaddr *) &server, > - sizeof(struct sockaddr_in)) == -1) { > - ups->upserror = UPSCLI_ERR_CONNFAILURE; > - ups->syserrno = errno; > - close(ups->fd); > - ups->fd = -1; > + for (rtmp = r; r != NULL; r = r->ai_next) { > + ups->fd = socket (r->ai_family, r->ai_socktype, r->ai_protocol); > + if (ups->fd < 0) { > + if (r->ai_next == NULL) { > + ups->upserror = UPSCLI_ERR_SOCKFAILURE; > + ups->syserrno = errno; > + break; > + } > + continue; >...
2018 Jan 22
3
tinc 1.1: freeaddrinfo(NULL) crash on windows
On Windows, freeaddrinfo(NULL) will result in a segv. In get_recent_address(), there is the following block of code: if(cache->aip) { sockaddr_t *sa = (sockaddr_t *)cache->aip->ai_addr; cache->aip = cache->aip->ai_next; if(!cache->aip) { freeaddrinfo(cache->aip); cache->aip = NULL; } return sa; } where freeaddrinfo() is called when cache->aip is guaranteed to be NULL. I get a bit confused with r...
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
2001 Jun 09
2
[PATCH] Make "-L" local ports bind to "127.0.0.1" in openssh-2.9p1
...rport, "%d", listen_port); - if (getaddrinfo(NULL, strport, &hints, &aitop) != 0) + if (getaddrinfo(gateway_ports ? NULL : "127.0.0.1", strport, &hints, &aitop) != 0) packet_disconnect("getaddrinfo: fatal error"); for (ai = aitop; ai; ai = ai->ai_next) {
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]
2000 Dec 07
1
[PATCH] tis authserv support
..._PASSIVE : 0; + + host = strdelim(addr); + service = strdelim(addr); + + if ((gaierr = getaddrinfo(host, service, &hints, &aitop)) != 0) + fatal("bad addr or host: %s (%s)\n", + host ? host : "<NULL>", + gai_strerror(gaierr)); + for (ai = aitop; ai->ai_next; ai = ai->ai_next) + ; + ai->ai_next = options->authserv_addrs; + options->authserv_addrs = aitop; + +} +#endif + /* * add listen address */ @@ -518,6 +559,14 @@ case sSkeyAuthentication: intptr = &options->skey_authentication; goto parse_flag; +#elif TIS_AUTH +...
2007 Sep 01
4
[Bug 1356] New: X11 forwarding broken.
http://bugzilla.mindrot.org/show_bug.cgi?id=1356 Summary: X11 forwarding broken. Product: Portable OpenSSH Version: 4.5p1 Platform: Other OS/Version: FreeBSD Status: NEW Severity: normal Priority: P2 Component: sshd AssignedTo: bitbucket at mindrot.org ReportedBy: marka at isc.org Created
2003 Mar 05
0
"rsync --daemon" and IPv4/v6 dual stack
...E ": getaddrinfo: bind address %s: %s\n", - bind_address, gai_strerror(error)); - return -1; - } /* We may not be able to create the socket, if for example the * machine knows about IPv6 in the C library, but not in the * kernel. */ - for (resp = all_ai; resp; resp = resp->ai_next) { - s = socket(resp->ai_family, resp->ai_socktype, - resp->ai_protocol); + s = socket(resp->ai_family, resp->ai_socktype, + resp->ai_protocol); - if (s == -1) - /* See if there's another address that will work... */ - continue; - - setsockopt(s, SOL_SOCKE...
2000 Jan 27
0
more NetBSD patches, for OpenSSH V1.2.2
...eval "ac_cv_file_$ac_safe=yes" else eval "ac_cv_file_$ac_safe=no" $NetBSD: patch-ab,v 1.1 2000/01/17 05:34:34 christos Exp $ --- fake-getaddrinfo.c.orig Sun Jan 16 23:45:39 2000 +++ fake-getaddrinfo.c Sun Jan 16 23:47:45 2000 @@ -41,7 +41,7 @@ do { next = ai->ai_next; free(ai); - } while (ai = next); + } while ((ai = next) != NULL); } #endif /* !HAVE_FREEADDRINFO */ @@ -53,8 +53,8 @@ { struct addrinfo *ai; - if (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + - sizeof(struct sockaddr_in))) { + if ((ai = (struct addrinfo *)mal...