From 1cd4ef17302866a705699da97472f18ee9ddb960 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 8 Jul 2015 16:00:50 -0600 Subject: [PATCH] Fix an assertion --- libc/net/lib_gethostbyaddr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc/net/lib_gethostbyaddr.c b/libc/net/lib_gethostbyaddr.c index 6460e718bc6..8ef37a91512 100644 --- a/libc/net/lib_gethostbyaddr.c +++ b/libc/net/lib_gethostbyaddr.c @@ -82,6 +82,8 @@ FAR struct hostent *gethostbyaddr(FAR const void *addr, socklen_t len, int type) int ret; DEBUGASSERT(addr != NULL); + DEBUGASSERT(type == AF_INET || type == AF_INET6); + ret = gethostbyaddr_r(addr, len, type, &g_hostent, g_hostbuffer, CONFIG_NETDB_BUFSIZE, &h_errno); return ret == 0 ? &g_hostent : NULL;