Martin Pool
7bea78ced6
With -vv, client shows a message when opening a daemon connection via
...
an HTTP proxy. This parallels the recent addition of a log message
for opening ssh connections.
2002-02-23 01:00:33 +00:00
Martin Pool
79845f2834
Doc.
2002-02-18 23:36:10 +00:00
Martin Pool
bd37c66630
Fix error handling for failing to fork after accepting a connection --
...
close fd, sleep, then try again.
2002-02-18 22:58:49 +00:00
Martin Pool
c4a5c57dc3
If the daemon is unable to fork a child to accept a connection, print
...
an error message. (Colin Walters)
2002-02-18 22:38:03 +00:00
David Dykstra
145794936f
Patch from Jos Backus <josb@cncdsl.com> to use HAVE_SOCKADDR_LEN rather
...
than HAVE_SOCK_SIN_LEN around use of sin_len. Correct usage was already
in place in clientname.c.
2002-02-13 18:45:17 +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
Martin Pool
0d95824995
Verbose messages for spoof check... doesn't work on old linux libc?
2002-01-24 09:42:52 +00:00
Martin Pool
bbc09ffba9
When doing a name->addr translation to check for spoofing, give the
...
resolver the address family of the original address as a hint, so that
we're more likely to find the correct A or AAAA record.,
2002-01-24 08:52:28 +00:00
Martin Pool
5fdcc397b1
Fix getpeername call.
2002-01-24 08:16:27 +00:00
Martin Pool
07d70ff560
Move both calls to getpeername into a common wrapper function that
...
handles IPV4_MAPPED addresses.
2002-01-24 08:05:22 +00:00
Martin Pool
00d943d513
Another size_t warning
2002-01-24 05:57:49 +00:00
Martin Pool
71c780da06
check_name: Print out name *before* clobbering it.
2002-01-24 05:57:22 +00:00
Martin Pool
2974e20550
If name lookup fails, then show the relevant IP address in the error message.
2002-01-24 05:41:46 +00:00
Martin Pool
255810c0d6
Doc.
...
Oops, connection program message was in the wrong place.
2002-01-24 04:24:12 +00:00
Martin Pool
5d2640376e
Show helper program with -v when opening connection.
...
Doc.
2002-01-24 04:21:42 +00:00
Martin Pool
d02984bbb7
Doc.
2002-01-24 04:19:41 +00:00
Martin Pool
0f9555207a
Fix const
2002-01-24 04:07:07 +00:00
Martin Pool
885448d74c
Unbreak the old behavior of using UNKNOWN as a hostname if any of the
...
addr->name->addr translations fail, because people might count on this
in "hosts deny" lines.
2002-01-24 04:03:06 +00:00
Martin Pool
b14545b3ff
Fix inverted sense of error check.
2002-01-24 03:31:28 +00:00
Martin Pool
9a5a86734f
Refactor client_name() into smaller functions.
...
Better messages for DNS failure.
If we can get a reverse name for an IP address, but not confirm that
it is correct using a forward lookup then we still proceed to use the
name, but also emit a warning.
2002-01-24 03:28:20 +00:00
Martin Pool
d1d1505045
Doc.
2002-01-24 03:03:20 +00:00
Martin Pool
d54765c442
Just for variety we have some socklen_t fixes too.
2002-01-23 07:57:43 +00:00
Martin Pool
a9b31409d5
Remove unused variable.
2002-01-15 10:04:48 +00:00
Martin Pool
98355b8086
Oops, getaddrinfo returns an error code (not -1) for error. -Wall is
...
good.
2002-01-15 10:04:11 +00:00
Martin Pool
362099a512
More comments about IPv6 stuff.
...
If a reverse name lookup fails, show the name that we were trying to
look up.
2002-01-11 08:24:34 +00:00
Martin Pool
9ec7528475
Typo
2001-12-18 06:48:56 +00:00
Martin Pool
f8be7d4219
Refactor code for setting local address on outgoing connections. If a
...
local address is specified, then try all addrinfo records for it.
2001-12-18 06:21:33 +00:00
Martin Pool
13e29995f5
Get rid of global_opts struct as suggested by Dave -- too many
...
problems with initialization.
Change the algorithm from trying to open an inbound socket with
getaddrinfo: keep trying suggested addresses until we find one on
which we can both get a socket and bind. Not convinced this is the
best, but it's probably better.
2001-12-18 05:54:57 +00:00
David Dykstra
cb1bcc7ebb
open_socket_in was attempting to try all the protocols returned from
...
getaddrinfo(), but only if a corresponding call to socket() returned one of
three *NOSUPPORT errno codes. A Redhat 6.2 system was observed returning
EINVAL instead so it never went on to try IPv4. This update adds EINVAL to
the list. Question: why not always continue through the list regardless of
what errno is?
2001-12-14 18:00:54 +00:00
Martin Pool
51f289d1e6
Some platforms don't have sa_family_t.
2001-12-05 13:44:37 +00:00
Martin Pool
d91c8c50d2
RFC2553 just says that sockaddr_storage has to have initial fields
...
isomorphic to sa_family etc from a struct sockaddr, not what they're
called. On some platforms they seem not to be called ss_family.
Rather than guess, we will try casting to a sockaddr and looking
through that -- I think this is what the RFC intends.
2001-12-05 13:25:29 +00:00
Martin Pool
e20a4f84d6
Some platforms may have getaddrinfo() but not sockaddr_storage.
2001-12-05 13:19:16 +00:00
Martin Pool
2d6dbe290c
Change back to using sockaddr_storage rather than sockaddr_in. If
...
sockaddr_storage is not defined, then supply our own definition that
will hopefully satisfy RFC2553 but also compile on all supported
platforms.
Thankyou to YOSHIFUJI Hideaki, SUMIKAWA Munechika and Jun-ichiro
"itojun" Hagino.
2001-12-05 12:48:46 +00:00
Martin Pool
c11b88061f
Fix missing parameter in log call.
2001-11-27 06:01:05 +00:00
Martin Pool
2be5d2daad
Remove kame cruft
2001-11-26 08:21:14 +00:00
Martin Pool
a57568d716
Oops, no C++ comments.
2001-11-26 07:47:59 +00:00
Martin Pool
61f543cade
Kill a function for jra.
2001-11-26 07:11:55 +00:00
Martin Pool
b8771f9615
Try to be better about handling the results of getaddrinfo(): when
...
opening an inbound socket, we might get several address results,
e.g. for the machine's ipv4 and ipv6 name.
If binding a wildcard, then any one of them should do. If an address
was specified but it's insufficiently specific then that's not our
fault.
However, some of the advertized addresses may not work because e.g. we
don't have IPv6 support in the kernel. In that case go on and try all
addresses until one succeeds.
2001-11-26 07:10:06 +00:00
Martin Pool
d5d4b28220
Put the new address family option into an options struct. We have too
...
many globals already.
Better error messages for network-related failures.
2001-11-26 04:52:19 +00:00
Martin Pool
1f0fa9318a
Remove highly suspicious redefinition of sockaddr structure -- there
...
seems no point using anything but the platform's native definition,
and if we can't get that from the system headers we're hosed anyhow.
2001-11-26 00:41:11 +00:00
Martin Pool
7ef6aa6405
Improved error messages.
2001-11-24 04:22:20 +00:00
Martin Pool
06963d0fca
Merge KAME.net IPv6 patch: you can now (in theory) pass IPv6 hostnames
...
or literal IP addresses to rsync, and if your platform supports them
they will be used. Also there are -4 and -6 command-line options to
choose the default address type. Thankyou!
2001-11-23 07:35:49 +00:00
Martin Pool
eecd22ff7b
Merge in the LIBSMB_PROG idea from samba, so that you can do
...
RSYNC_CONNECT_PROG='./rsync --daemon' ./rsync -vvvvvv localhost::
to test as a daemon without actually having to listen on a port.
2001-08-31 07:06:13 +00:00
Martin Pool
7d91d5a619
Check that gethostbyname does actually return AF_INET addresses, since
...
that's all we can handle.
Also, try a new method of handling in_addr and hostent that will
hopefully work on Cray machines without 32-bit types.
2001-08-15 07:52:28 +00:00
Martin Pool
c1f62a573a
Use socklen_t for getpeername, since we hopefully now have it defined
...
on all platforms.
2001-08-15 06:47:40 +00:00
Martin Pool
f8014b864e
Typo. Shouldn't depend on assert().
2001-08-15 05:47:29 +00:00
Martin Pool
d58911fb37
Better error messages for DNS.
2001-08-15 05:08:07 +00:00
Andrew Tridgell
376acbfad5
don't need to lookup our own name in open_socket_in()
2001-08-08 08:55:24 +00:00
Martin Pool
546434f867
Two more instances of socklen_t.
2001-08-06 12:31:23 +00:00
Martin Pool
ac2a1a449d
Use socklen_t if defined, or otherwise int. This tries to fix
...
warnings on platforms (e.g. AIX) where this type is defined and not
int.
2001-08-06 12:27:04 +00:00