kopia lustrzana https://gitlab.com/sane-project/backends
Rework Ilia's changes in check_host().
rodzic
7a359270a2
commit
9cdf75633d
|
@ -1,6 +1,7 @@
|
|||
2009-03-13 Julien Blache <jb@jblache.org>
|
||||
* doc/descriptions-external/epkowa.desc: update for iScan 2.18.0,
|
||||
from Olaf Meeuwissen.
|
||||
* frontend/saned.c: rework Ilia's changes in check_host().
|
||||
|
||||
2009-03-12 Ilia Sotnikov <hostcc@gmail.com>
|
||||
* frontend/saned.c:
|
||||
|
|
|
@ -867,11 +867,13 @@ check_host (int fd)
|
|||
|
||||
res = NULL;
|
||||
err = getaddrinfo (hostname, NULL, &hints, &res);
|
||||
/* Proceed if no local name was found */
|
||||
if (err && err != EAI_NONAME)
|
||||
if (err)
|
||||
{
|
||||
DBG (DBG_ERR, "check_host: getaddrinfo failed: %s\n",
|
||||
DBG (DBG_ERR, "check_host: getaddrinfo for local hostname failed: %s\n",
|
||||
gai_strerror (err));
|
||||
|
||||
/* Proceed even if the local hostname does not resolve */
|
||||
if (err != EAI_NONAME)
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
else
|
||||
|
@ -1168,19 +1170,22 @@ check_host (int fd)
|
|||
|
||||
/* Get local address */
|
||||
he = gethostbyname (hostname);
|
||||
/* Proceed if no local name was found */
|
||||
if (!he && h_errno != HOST_NOT_FOUND)
|
||||
|
||||
if (!he)
|
||||
{
|
||||
DBG (DBG_ERR, "check_host: gethostbyname failed: %s\n",
|
||||
DBG (DBG_ERR, "check_host: gethostbyname for local hostname failed: %s\n",
|
||||
hstrerror (h_errno));
|
||||
|
||||
/* Proceed even if the local hostname doesn't resolve */
|
||||
if (h_errno != HOST_NOT_FOUND)
|
||||
return SANE_STATUS_INVAL;
|
||||
}
|
||||
|
||||
if (he)
|
||||
else
|
||||
{
|
||||
DBG (DBG_DBG, "check_host: local hostname (from DNS): %s\n",
|
||||
he->h_name);
|
||||
|
||||
if (he && ((he->h_length == 4) || he->h_addrtype == AF_INET))
|
||||
if ((he->h_length == 4) || (he->h_addrtype == AF_INET))
|
||||
{
|
||||
if (!inet_ntop (he->h_addrtype, he->h_addr_list[0], text_addr,
|
||||
sizeof (text_addr)))
|
||||
|
@ -1203,6 +1208,7 @@ check_host (int fd)
|
|||
|
||||
DBG (DBG_DBG,
|
||||
"check_host: remote host doesn't have same addr as local\n");
|
||||
}
|
||||
|
||||
/* must be a remote host: check contents of PATH_NET_CONFIG or
|
||||
/etc/hosts.equiv if former doesn't exist: */
|
||||
|
|
Ładowanie…
Reference in New Issue