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>
static bool
bfd_lookup_ip(const char *host_name, struct in_addr *addr)
{
static bool
bfd_lookup_ip(const char *host_name, struct in_addr *addr)
{
- if (!inet_aton(host_name, addr)) {
+ if (!inet_pton(AF_INET, host_name, addr)) {
VLOG_ERR_RL(&rl, "\"%s\" is not a valid IP address", host_name);
return false;
}
VLOG_ERR_RL(&rl, "\"%s\" is not a valid IP address", host_name);
return false;
}
int
lookup_ip(const char *host_name, struct in_addr *addr)
{
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;
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;
struct addrinfo *result;
struct addrinfo hints;
struct addrinfo *result;
struct addrinfo hints;
- if (inet_aton(host_name, addr)) {
+ if (inet_pton(AF_INET, host_name, addr)) {
/* If there's no local interface or no IP address, give up. */
local_iface = iface_from_ofp_port(br, OFPP_LOCAL);
/* If there's no local interface or no IP address, give up. */
local_iface = iface_from_ofp_port(br, OFPP_LOCAL);
- if (!local_iface || !c->local_ip || !inet_aton(c->local_ip, &ip)) {
+ if (!local_iface || !c->local_ip
+ || !inet_pton(AF_INET, c->local_ip, &ip)) {
/* Configure the IP address and netmask. */
if (!c->local_netmask
/* Configure the IP address and netmask. */
if (!c->local_netmask
- || !inet_aton(c->local_netmask, &mask)
+ || !inet_pton(AF_INET, c->local_netmask, &mask)
|| !mask.s_addr) {
mask.s_addr = guess_netmask(ip.s_addr);
}
|| !mask.s_addr) {
mask.s_addr = guess_netmask(ip.s_addr);
}
/* Configure the default gateway. */
if (c->local_gateway
/* Configure the default gateway. */
if (c->local_gateway
- && inet_aton(c->local_gateway, &gateway)
+ && inet_pton(AF_INET, c->local_gateway, &gateway)
&& gateway.s_addr) {
if (!netdev_add_router(netdev, gateway)) {
VLOG_INFO("bridge %s: configured gateway "IP_FMT,
&& gateway.s_addr) {
if (!netdev_add_router(netdev, gateway)) {
VLOG_INFO("bridge %s: configured gateway "IP_FMT,