summaryrefslogtreecommitdiff
path: root/lib/socket-util.c
diff options
context:
space:
mode:
authorGurucharan Shetty <gshetty@nicira.com>2014-02-21 09:18:35 -0800
committerGurucharan Shetty <gshetty@nicira.com>2014-02-21 14:44:31 -0800
commit1bbd17282444f67e6509ecc930326ec4314da93f (patch)
treebd79367add568f602d22ef12d70ce2849f5ab0b7 /lib/socket-util.c
parent4f57ad100f4556c45a7ad4c4fe904545a99976e5 (diff)
downloadopenvswitch-1bbd17282444f67e6509ecc930326ec4314da93f.tar.gz
Replace inet_aton() with inet_pton().
Windows does not have inet_aton(), but does have a inet_pton(). inet_aton() is not defined in POSIX. But inet_pton() is. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/socket-util.c')
-rw-r--r--lib/socket-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/socket-util.c b/lib/socket-util.c
index c1c41ec30..b0ff7cfc1 100644
--- a/lib/socket-util.c
+++ b/lib/socket-util.c
@@ -128,7 +128,7 @@ set_dscp(int fd, uint8_t dscp)
int
lookup_ip(const char *host_name, struct in_addr *addr)
{
- if (!inet_aton(host_name, addr)) {
+ if (!inet_pton(AF_INET, host_name, addr)) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
VLOG_ERR_RL(&rl, "\"%s\" is not a valid IP address", host_name);
return ENOENT;
@@ -165,7 +165,7 @@ lookup_hostname(const char *host_name, struct in_addr *addr)
struct addrinfo *result;
struct addrinfo hints;
- if (inet_aton(host_name, addr)) {
+ if (inet_pton(AF_INET, host_name, addr)) {
return 0;
}