[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
small inet_ntop fix
From: |
Simon Josefsson |
Subject: |
small inet_ntop fix |
Date: |
Sat, 17 Jun 2006 20:48:56 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) |
Hi Yoann! Ok to install this? The reason is that inet_ntop6 calls
inet_nto4, so it doesn't make sense to make IPv4 optional. The
current code wouldn't work on a platform that HAVE_IPV6 but not
HAVE_IPV4, if there are any.
--- inet_ntop.c 16 Jun 2006 17:35:21 +0200 1.3
+++ inet_ntop.c 17 Jun 2006 20:47:22 +0200
@@ -1,5 +1,5 @@
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
- Copyright (c) 2005 Free Software Foundation, Inc.
+ Copyright (c) 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -56,9 +56,7 @@
*/
typedef int verify_int_size[2 * sizeof (int) - 7];
-#if HAVE_IPV4
static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t
size);
-#endif
#if HAVE_IPV6
static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t
size);
#endif
@@ -78,10 +76,8 @@
{
switch (af)
{
-#if HAVE_IPV4
case AF_INET:
return (inet_ntop4 (src, dst, cnt));
-#endif
#if HAVE_IPV6
case AF_INET6:
@@ -95,8 +91,6 @@
/* NOTREACHED */
}
-#if HAVE_IPV4
-
/* const char *
* inet_ntop4(src, dst, size)
* format an IPv4 address
@@ -127,8 +121,6 @@
return strcpy (dst, tmp);
}
-#endif
-
#if HAVE_IPV6
/* const char *
- small inet_ntop fix,
Simon Josefsson <=