DO_HOST_LOOKUP option is ignored
Matt Johnston
matt at ucc.asn.au
Tue Mar 1 02:07:30 WST 2005
And cc to the list...
On Mon, Feb 28, 2005 at 02:58:03PM -0300, Claudio Roberto Cussuol wrote:
> > I've tracked down the version 0.43 and found it's use inside the dbutils.c
> file
> > but this portion of code doesn't exist anymore. The only use of the function
> > gethostbyaddr i've found in 0.44 is inside the file fake-rfc2553.c.
>
> Matt
>
> Now you're back, can you do something about this problem.
> I've tried to fix it myself but have no success.
Ah sorry, I thought I'd sent the patch to the list, but
obviously hadn't. Attached should be a fix.
I'll put out 0.45 soon, once I've sorted out a few remaining
issues.
Matt
-------------- next part --------------
#
# patch "dbutil.c"
# from [8b3d574e5857f596259ae610db1507c11c150b6d]
# to [77ff997b12541085494a855acbcef332497c8e3a]
#
# patch "options.h"
# from [4f331e42fbe00636bb01fb871ce8cbdf673852c8]
# to [ac14d24a7eadb33fbb4c36865f48cca9d4ccae15]
#
--- dbutil.c
+++ dbutil.c
@@ -397,6 +397,11 @@
char sbuf[NI_MAXSERV];
int ret;
unsigned int len;
+#ifdef DO_HOST_LOOKUP
+ const int flags = NI_NUMERICSERV;
+#else
+ const int flags = NI_NUMERICHOST | NI_NUMERICSERV;
+#endif
len = sizeof(struct sockaddr_storage);
/* Some platforms such as Solaris 8 require that len is the length
@@ -410,8 +415,9 @@
}
#endif
+
ret = getnameinfo((struct sockaddr*)addr, len, hbuf, sizeof(hbuf),
- sbuf, sizeof(sbuf), NI_NUMERICSERV);
+ sbuf, sizeof(sbuf), flags);
if (ret != 0) {
/* On some systems (Darwin does it) we get EINTR from getnameinfo
--- options.h
+++ options.h
@@ -96,9 +96,7 @@
* if the random number source isn't good. In general this isn't required */
/* #define DSS_PROTOK */
-/* Whether to do reverse DNS lookups. This is advisable, though will add
- * code size with gethostbyname() etc, so for very small environments where
- * you are statically linking, you might want to undefine this */
+/* Whether to do reverse DNS lookups. */
#define DO_HOST_LOOKUP
/* Whether to print the message of the day (MOTD). This doesn't add much code
More information about the Dropbear
mailing list