summaryrefslogtreecommitdiffstats
path: root/extensions/libebt_among.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-04-27 09:12:53 +0200
committerPhil Sutter <phil@nwl.cc>2021-04-30 03:39:56 +0200
commitacac2dbe64e5120394fa715bb5fe95c42d08b8b3 (patch)
tree9169eae1ddb6b5884d3901909b0f392ff5805464 /extensions/libebt_among.c
parent9084ef290a39d42d802204c9e80d7263c2c95ea2 (diff)
Eliminate inet_aton() and inet_ntoa()
Both functions are obsolete, replace them by equivalent calls to inet_pton() and inet_ntop(). Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'extensions/libebt_among.c')
-rw-r--r--extensions/libebt_among.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/extensions/libebt_among.c b/extensions/libebt_among.c
index 2b9a1b65..7eb898f9 100644
--- a/extensions/libebt_among.c
+++ b/extensions/libebt_among.c
@@ -66,7 +66,7 @@ parse_nft_among_pair(char *buf, struct nft_among_pair *pair, bool have_ip)
if (sep) {
*sep = '\0';
- if (!inet_aton(sep + 1, &pair->in))
+ if (!inet_pton(AF_INET, sep + 1, &pair->in))
xtables_error(PARAMETER_PROBLEM,
"Invalid IP address '%s'\n", sep + 1);
}
@@ -194,6 +194,7 @@ static void __bramong_print(struct nft_among_pair *pairs,
int cnt, bool inv, bool have_ip)
{
const char *isep = inv ? "! " : "";
+ char abuf[INET_ADDRSTRLEN];
int i;
for (i = 0; i < cnt; i++) {
@@ -202,7 +203,8 @@ static void __bramong_print(struct nft_among_pair *pairs,
printf("%s", ether_ntoa(&pairs[i].ether));
if (pairs[i].in.s_addr != INADDR_ANY)
- printf("=%s", inet_ntoa(pairs[i].in));
+ printf("=%s", inet_ntop(AF_INET, &pairs[i].in,
+ abuf, sizeof(abuf)));
}
printf(" ");
}