Commit af32f69e authored by Martin Pool's avatar Martin Pool

Doc.

parent 0cd2f407
...@@ -99,7 +99,10 @@ char *client_name(int fd) ...@@ -99,7 +99,10 @@ char *client_name(int fd)
/** /**
* Get the sockaddr for the client. * Get the sockaddr for the client.
*
* If it comes in as an ipv4 address mapped into IPv6 format then we
* convert it back to a regular IPv4.
**/ **/
void client_sockaddr(int fd, void client_sockaddr(int fd,
struct sockaddr_storage *ss, struct sockaddr_storage *ss,
...@@ -172,9 +175,12 @@ int lookup_name(int fd, const struct sockaddr_storage *ss, ...@@ -172,9 +175,12 @@ int lookup_name(int fd, const struct sockaddr_storage *ss,
/* Do a forward lookup on name_buf and make sure it corresponds to ss /**
* -- otherwise we may be being spoofed. If we suspect we are, then * Do a forward lookup on @p name_buf and make sure it corresponds to
* we don't abort the connection but just emit a warning. */ * @p ss -- otherwise we may be being spoofed. If we suspect we are,
* then we don't abort the connection but just emit a warning, and
* change @p name_buf to be "UNKNOWN".
**/
int check_name(int fd, int check_name(int fd,
const struct sockaddr_storage *ss, const struct sockaddr_storage *ss,
socklen_t ss_len, socklen_t ss_len,
...@@ -192,9 +198,8 @@ int check_name(int fd, ...@@ -192,9 +198,8 @@ int check_name(int fd,
error = getaddrinfo(name_buf, port_buf, &hints, &res0); error = getaddrinfo(name_buf, port_buf, &hints, &res0);
if (error) { if (error) {
rprintf(FERROR, rprintf(FERROR,
RSYNC_NAME ": forward name lookup for %s:%s failed: %s\n", RSYNC_NAME ": forward name lookup for %s failed: %s\n",
name_buf, port_buf, name_buf, gai_strerror(error));
gai_strerror(error));
strcpy(name_buf, default_name); strcpy(name_buf, default_name);
return error; return error;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment