Commit Graph

15 Commits

Author SHA1 Message Date
Wayne Davison
aaf375d0a5 The inet_pton() man page says we need to pass in a pointer to a
struct in_addr, which means passing &sin.sin_addr instead of
&sin.sin_addr.s_addr.  Also changed the AF_INET6 version to pass
&sin6.sin6_addr.  Hopefully this will fix UNICOS and not break
anyone else.
2003-01-11 02:05:56 +00:00
David Dykstra
bc2b4963a0 Support IPv6 addresses with "hosts allow" and "hosts deny". Patch from
Hideaki Yoshifuji.
2003-01-09 21:14:10 +00:00
Wayne Davison
3b5f6214a6 * Don't call getnameinfo() if we've already populated the addr_buf.
* Moved some structures in client_name() so that they remain in-scope for
  the entire function (since we set pointers to their storage location).
* Allow the dot-counting loop to increment to 4 instead of stopping at 3.
2002-08-02 17:11:39 +00:00
David Dykstra
542ad675b9 Put in better method of checking whether or not daemon over --rsh mode is
in place: simply check the "am_server" global variable, which is not set
true when the daemon is listening for connections (daemon_main is not
called in main.c if am_server is set).
2002-08-02 15:39:43 +00:00
David Dykstra
1e736b8ff7 Fix client_name to work on when INET6 is enabled but using a 4-part IPv4
IP address.  Tested on Linux, but only with an IPv4 ssh.  Somebody who has
IPv6 enabled on ssh needs to test it yet.
2002-08-02 15:05:03 +00:00
David Dykstra
a6d8c3f336 Fix last change to use correct IPv6 structure names when using INET6.
Doesn't yet look up names correctly on Linux with INET6 enabled, however;
needs further work but I don't have time right now.
2002-08-01 21:57:23 +00:00
David Dykstra
09021eabb5 Fix to correctly identify remote IP address and host name when using
-e ssh and :: together.  Uses $SSH_CLIENT to locate the IP address
(was attempting to before but it didn't always work) and then uses
inet_pton() on that and getnameinfo() to find the name.
2002-08-01 19:17:00 +00:00
Martin Pool
6c92af2067 Commit patch based on one from John L. Allen to fix "forward name
lookup failed" on AIX 4.3.3.

When doing an name->addr lookup on the client address, there's no
point including the service name, because it can't be spoofed and it
apparently causes trouble when not present in /etc/services.
2002-04-03 02:33:42 +00:00
Martin Pool
be8bd99aa4 check_name doesn't need a socklen_t, because it knows what is inside
each sockaddr type.
2002-01-25 22:59:37 +00:00
Martin Pool
6780f72000 Add code to compare sin6_addrs. 2002-01-25 02:45:09 +00:00
Martin Pool
39e01d2d4b Back out last change -- to see whether an address is spoofed, we don't
want to look at the whole sockaddr, but rather just at the sin_addr
that it contains.

Also fix silly bug where ai_flags was set incorrectly for getaddrinfo.
2002-01-25 02:43:35 +00:00
Martin Pool
f75502950b compare_addrinfo_sockaddr: Add code to compare AF_INET6 addresses. 2002-01-25 02:37:20 +00:00
Martin Pool
974f27e7e9 Split out code to compare addrinfo and sockaddr into it's own
function.  The comparison cannot be done just byte-by-byte, because
different parts of the sockaddr will be meaningful depending on the
protocol.  It looks like on some systems the library sets the unused
parts to 0, but this is not reliable.  IPv6 not implemented yet.
2002-01-25 02:29:53 +00:00
Martin Pool
af32f69eb0 Doc. 2002-01-25 02:15:58 +00:00
Martin Pool
0cd2f40764 The name resolution stuff is getting complicated -- split it out into
its own file.
2002-01-25 02:13:04 +00:00