From acac2dbe64e5120394fa715bb5fe95c42d08b8b3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 27 Apr 2021 09:12:53 +0200 Subject: 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 --- extensions/libebt_among.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'extensions/libebt_among.c') 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(" "); } -- cgit v1.2.3