From 434eeefe52524cc06cb5bbe3cef59793d5fe7ec2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Jul 2015 16:45:42 -0600 Subject: [PATCH] inet_pton and ntop need to support IPv4 and IPv6 addressing unconditionally for the netdb logic --- libc/net/lib_inetntop.c | 15 +++++++++++++++ libc/net/lib_inetpton.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/libc/net/lib_inetntop.c b/libc/net/lib_inetntop.c index 1f3d33c6f4..e788f768de 100644 --- a/libc/net/lib_inetntop.c +++ b/libc/net/lib_inetntop.c @@ -53,6 +53,21 @@ #include +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* If netdb support is enabled, then we need to be able to manage IPv4 and + * IPv6 addresses, regardless of networking support. + */ + +#ifdef CONFIG_LIB_NETDB +# undef CONFIG_NET_IPv4 +# undef CONFIG_NET_IPv6 +# define CONFIG_NET_IPv4 1 +# define CONFIG_NET_IPv6 1 +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/libc/net/lib_inetpton.c b/libc/net/lib_inetpton.c index 72229d2f2c..fda5a9d486 100644 --- a/libc/net/lib_inetpton.c +++ b/libc/net/lib_inetpton.c @@ -55,6 +55,21 @@ #include #include +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* If netdb support is enabled, then we need to be able to manage IPv4 and + * IPv6 addresses, regardless of networking support. + */ + +#ifdef CONFIG_LIB_NETDB +# undef CONFIG_NET_IPv4 +# undef CONFIG_NET_IPv6 +# define CONFIG_NET_IPv4 1 +# define CONFIG_NET_IPv6 1 +#endif + /**************************************************************************** * Private Functions ****************************************************************************/