Convert all inet_aton() to inet_pton() since inet_pton() is POSIX.
This commit is contained in:
parent
b89c694bc9
commit
af365be9b7
@ -173,7 +173,7 @@ void perform_ip(int idx, char *str)
|
|||||||
return;
|
return;
|
||||||
if (!is_permitted(ifnam[idx]))
|
if (!is_permitted(ifnam[idx]))
|
||||||
return;
|
return;
|
||||||
if (!inet_aton(str, &ipaddr))
|
if (!inet_pton(AF_INET, str, &ipaddr))
|
||||||
return;
|
return;
|
||||||
if (set_if_flag(idx, (IFF_UP | IFF_RUNNING)))
|
if (set_if_flag(idx, (IFF_UP | IFF_RUNNING)))
|
||||||
return;
|
return;
|
||||||
@ -208,7 +208,7 @@ void perform_subnet(int idx, char *str)
|
|||||||
return;
|
return;
|
||||||
if (!is_permitted(ifnam[idx]))
|
if (!is_permitted(ifnam[idx]))
|
||||||
return;
|
return;
|
||||||
if (!inet_aton(str, &subnet))
|
if (!inet_pton(AF_INET, str, &subnet))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strlcpy(ifrt.ifr_name, ifnam[idx], IFNAMSIZ);
|
strlcpy(ifrt.ifr_name, ifnam[idx], IFNAMSIZ);
|
||||||
@ -245,7 +245,7 @@ void perform_router(int idx, char *str)
|
|||||||
return;
|
return;
|
||||||
if (!is_permitted(ifnam[idx]))
|
if (!is_permitted(ifnam[idx]))
|
||||||
return;
|
return;
|
||||||
if (!inet_aton(str, &router))
|
if (!inet_pton(AF_INET, str, &router))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
memset(&rt, 0, sizeof(struct rtentry));
|
memset(&rt, 0, sizeof(struct rtentry));
|
||||||
@ -316,7 +316,7 @@ void perform_broadcast(int idx, char *str)
|
|||||||
return;
|
return;
|
||||||
if (!is_permitted(ifnam[idx]))
|
if (!is_permitted(ifnam[idx]))
|
||||||
return;
|
return;
|
||||||
if (!inet_aton(str, &broadcast))
|
if (!inet_pton(AF_INET, str, &broadcast))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strlcpy(ifrt.ifr_name, ifnam[idx], IFNAMSIZ);
|
strlcpy(ifrt.ifr_name, ifnam[idx], IFNAMSIZ);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user