[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Inetutils branch, master, updated. inetutils-1_7-25-g4b1d470
From: |
Simon Josefsson |
Subject: |
[SCM] GNU Inetutils branch, master, updated. inetutils-1_7-25-g4b1d470 |
Date: |
Wed, 13 Jan 2010 15:31:50 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".
The branch, master has been updated
via 4b1d4704233377254a05d2dd830c77cb3e286b79 (commit)
from 23fe7f9e2336c34e47932596b75b802ae1834127 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=4b1d4704233377254a05d2dd830c77cb3e286b79
commit 4b1d4704233377254a05d2dd830c77cb3e286b79
Author: Simon Josefsson <address@hidden>
Date: Wed Jan 13 16:31:43 2010 +0100
Use gnulib getaddrinfo module.
diff --git a/ChangeLog b/ChangeLog
index 0455c1d..74c37c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-12 Simon Josefsson <address@hidden>
+
+ * whois/whois.c (openconn) [!HAVE_GETADDRINFO]: Remove variables
+ hostinfo, servinfo, and saddr and supporting code.
+ * src/inetd.c (servtab): Remove !HAVE_GETADDRINFO support.
+ (setup) [!HAVE_GETADDRINFO]: Remove function.
+ (expand_enter) [!HAVE_GETADDRINFO]: Remove function.
+ * configure.ac: Remove HAVE_GETADDRINFO variable. Don't check for
+ getaddrinfo.
+ * bootstrap.conf (gnulib_modules): Add getaddrinfo.
+
2010-01-13 Simon Josefsson <address@hidden>
* TODO: Update.
diff --git a/bootstrap.conf b/bootstrap.conf
index fca66cd..5483dbe 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -34,6 +34,7 @@ exitfail
extensions
fdl-1.3
filemode
+getaddrinfo
getcwd
getline
getopt-gnu
diff --git a/configure.ac b/configure.ac
index cfb8ef1..d234487 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,12 +329,6 @@ if test ! "X$ipv6" = "Xno" -a "X$working_ipv6" = "Xyes";
then
AC_CHECK_TYPE(struct addrinfo, , working_ipv6=no, [#include <netdb.h>])
fi
-AH_TEMPLATE([HAVE_GETADDRINFO],[Define to 1 if you have getaddrinfo(3)])
-AC_CHECK_FUNC(getaddrinfo,
- [AC_DEFINE([HAVE_GETADDRINFO],1)],
- [working_ipv6=no
- AC_DEFINE([HAVE_GETADDRINFO],0)], [#include <netdb.h>])
-
if test ! "X$ipv6" = "Xno" -a "X$working_ipv6" = "Xyes"; then
AC_CHECK_FUNC(getnameinfo, ,working_ipv6=no, [#include <netdb.h>])
fi
diff --git a/src/inetd.c b/src/inetd.c
index 72e232f..aa98a2c 100644
--- a/src/inetd.c
+++ b/src/inetd.c
@@ -267,11 +267,7 @@ struct servtab
int se_type; /* type */
sa_family_t se_family; /* address family of the socket */
char se_v4mapped; /* 1 = accept v4mapped connection, 0 = don't */
-#if HAVE_GETADDRINFO
struct sockaddr_storage se_ctrladdr; /* bound address */
-#else
- struct sockaddr_in se_ctrladdr; /* bound address */
-#endif
unsigned se_refcnt;
int se_count; /* number started since se_time */
struct timeval se_time; /* start of se_count */
@@ -550,7 +546,6 @@ print_service (const char *action, struct servtab *sep)
/* Configuration */
-#if HAVE_GETADDRINFO
int
setup (struct servtab *sep)
{
@@ -631,56 +626,6 @@ setup (struct servtab *sep)
}
return 0;
}
-#else
-void
-setup (struct servtab *sep)
-{
- int err;
- const int on = 1;
-
- sep->se_fd = socket (sep->se_family, sep->se_socktype, 0);
- if (sep->se_fd < 0)
- {
- if (debug)
- fprintf (stderr, "socket failed on %s/%s: %s\n",
- sep->se_service, sep->se_proto, strerror (errno));
- syslog (LOG_ERR, "%s/%s: socket: %m", sep->se_service, sep->se_proto);
- return 1;
- }
-
- if (strncmp (sep->se_proto, "tcp", 3) == 0 && (options & SO_DEBUG))
- {
- err = setsockopt (sep->se_fd, SOL_SOCKET, SO_DEBUG,
- (char *) &on, sizeof (on));
- if (err < 0)
- syslog (LOG_ERR, "setsockopt (SO_DEBUG): %m");
- }
-
- err = setsockopt (sep->se_fd, SOL_SOCKET, SO_REUSEADDR,
- (char *) &on, sizeof (on));
- if (err < 0)
- syslog (LOG_ERR, "setsockopt (SO_REUSEADDR): %m");
-
- err = bind (sep->se_fd, (struct sockaddr *) &sep->se_ctrladdr,
- sizeof (sep->se_ctrladdr));
- if (err < 0)
- {
- if (debug)
- fprintf (stderr, "bind failed on %s/%s: %s\n",
- sep->se_service, sep->se_proto, strerror (errno));
- syslog (LOG_ERR, "%s/%s: bind: %m", sep->se_service, sep->se_proto);
- close (sep->se_fd);
- sep->se_fd = -1;
- if (!timingout)
- {
- timingout = 1;
- alarm (RETRYTIME);
- }
- return 1;
- }
- return 0;
-}
-#endif
void
servent_setup (struct servtab *sep)
@@ -802,7 +747,6 @@ enter (struct servtab *cp)
return sep;
}
-#if HAVE_GETADDRINFO
int
inetd_getaddrinfo (struct servtab *sep, int proto, struct addrinfo **result)
{
@@ -879,67 +823,6 @@ expand_enter (struct servtab *sep)
return 0;
}
-#else
-int
-expand_enter (struct servtab *sep)
-{
- struct servent *sp;
-
- sp = getservbyname (sep->se_service, sep->se_proto);
- if (sp == 0)
- {
- static struct servent servent;
- char *p;
- unsigned long val;
- unsigned short port;
-
- val = strtoul (sep->se_service, &p, 0);
- if (*p || (port = val) != val)
- {
- syslog (LOG_ERR, "%s/%s: unknown service",
- sep->se_service, sep->se_proto);
- sep->se_checked = 0;
- return 1;
- }
- servent.s_port = htons (port);
- sp = &servent;
- }
- if (sp->s_port != sep->se_ctrladdr.sin_port)
- {
- sep->se_ctrladdr.sin_family = AF_INET;
- sep->se_ctrladdr.sin_port = sp->s_port;
- }
- if (sep->se_node == NULL)
- {
- cp = enter (sep);
- servent_setup (cp);
- }
- else
- {
- char **p;
- struct hostent *host = gethostbyname (sep->se_node);
- if (!host)
- {
- syslog (LOG_ERR, "%s/%s: unknown host %s",
- sep->se_service, sep->se_proto, sep->se_node);
- return 1;
- }
- if (host->h_addrtype != AF_INET)
- {
- syslog (LOG_ERR, "%s/%s: unsupported address family %d",
- sep->se_service, sep->se_proto, host->h_addrtype);
- return 1;
- }
- for (p = host->h_addr_list; *p; p++)
- {
- memcpy (&sep->se_ctrladdr.sin_addr.s_addr, *p, host->h_length);
- cp = enter (sep);
- servent_setup (cp);
- }
- }
- return 0;
-}
-#endif
/* Configuration parser */
diff --git a/whois/whois.c b/whois/whois.c
index 9552564..0152d72 100644
--- a/whois/whois.c
+++ b/whois/whois.c
@@ -558,16 +558,9 @@ int
openconn (const char *server, const char *port)
{
int fd;
-#ifdef HAVE_GETADDRINFO
int i;
struct addrinfo hints, *res, *ressave;
-#else
- struct hostent *hostinfo;
- struct servent *servinfo;
- struct sockaddr_in saddr;
-#endif
-#ifdef HAVE_GETADDRINFO
memset (&hints, 0, sizeof (struct addrinfo));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
@@ -588,27 +581,6 @@ openconn (const char *server, const char *port)
if (!res)
err_sys ("connect");
freeaddrinfo (ressave);
-#else
- if ((hostinfo = gethostbyname (server)) == NULL)
- err_quit (_("Host %s not found."), server);
- if ((fd = socket (PF_INET, SOCK_STREAM, IPPROTO_IP)) < 0)
- err_sys ("socket");
- memset (&saddr, 0, sizeof (saddr));
- saddr.sin_addr = *(struct in_addr *) hostinfo->h_addr;
- saddr.sin_family = AF_INET;
- if (!port)
- {
- saddr.sin_port = htons (43);
- }
- else if ((saddr.sin_port = htons (atoi (port))) == 0)
- {
- if ((servinfo = getservbyname (port, "tcp")) == NULL)
- err_quit (_("%s/tcp: unknown service"), port);
- saddr.sin_port = servinfo->s_port;
- }
- if (connect (fd, &saddr, sizeof (saddr)) < 0)
- err_sys ("connect");
-#endif
return (fd);
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 +++++
bootstrap.conf | 1 +
configure.ac | 6 ---
src/inetd.c | 117 --------------------------------------------------------
whois/whois.c | 28 -------------
5 files changed, 12 insertions(+), 151 deletions(-)
hooks/post-receive
--
GNU Inetutils
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Inetutils branch, master, updated. inetutils-1_7-25-g4b1d470,
Simon Josefsson <=