diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-21 14:27:29 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-21 14:27:29 +0000 |
commit | 534e6f9339b644ffac02190dd32257bb190e3356 (patch) | |
tree | d3b12fcc78b5ad0e8e25c7e3f068be047b461d91 /iptables/xtables-standalone.c | |
parent | 735bd681a5ee12a17c67917603467acaf4a58f33 (diff) | |
parent | fae46950c0c0818cac1b37a7042b86fb03a75511 (diff) | |
download | iptables-android12-mainline-adbd-release.tar.gz |
Snap for 7478028 from fae46950c0c0818cac1b37a7042b86fb03a75511 to mainline-adbd-releaseandroid-mainline-12.0.0_r97android-mainline-12.0.0_r85android-mainline-12.0.0_r68android-mainline-12.0.0_r41android-mainline-12.0.0_r21android-mainline-12.0.0_r1android12-mainline-adbd-release
Change-Id: I9fc6994d9e9199c968ae3ec824b9d8e629c16169
Diffstat (limited to 'iptables/xtables-standalone.c')
-rw-r--r-- | iptables/xtables-standalone.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/iptables/xtables-standalone.c b/iptables/xtables-standalone.c index 1a28c548..7b71db62 100644 --- a/iptables/xtables-standalone.c +++ b/iptables/xtables-standalone.c @@ -44,9 +44,7 @@ xtables_main(int family, const char *progname, int argc, char *argv[]) { int ret; char *table = "filter"; - struct nft_handle h = { - .family = family, - }; + struct nft_handle h; xtables_globals.program_name = progname; ret = xtables_init_all(&xtables_globals, family); @@ -61,7 +59,7 @@ xtables_main(int family, const char *progname, int argc, char *argv[]) init_extensions4(); #endif - if (nft_init(&h, xtables_ipv4) < 0) { + if (nft_init(&h, family, xtables_ipv4) < 0) { fprintf(stderr, "%s/%s Failed to initialize nft: %s\n", xtables_globals.program_name, xtables_globals.program_version, @@ -74,16 +72,13 @@ xtables_main(int family, const char *progname, int argc, char *argv[]) ret = nft_commit(&h); nft_fini(&h); + xtables_fini(); if (!ret) { - if (errno == EINVAL) { - fprintf(stderr, "iptables: %s. " - "Run `dmesg' for more information.\n", - nft_strerror(errno)); - } else { - fprintf(stderr, "iptables: %s.\n", - nft_strerror(errno)); - } + fprintf(stderr, "%s: %s.%s\n", progname, nft_strerror(errno), + (errno == EINVAL ? + " Run `dmesg' for more information." : "")); + if (errno == EAGAIN) exit(RESOURCE_PROBLEM); } |