mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-12-07 08:33:53 +01:00
extensions: make print (iptables -L) output the same as save (-S)
This commit is contained in:
@@ -251,31 +251,6 @@ geoip_final_check(unsigned int flags)
|
||||
"geoip: missing arguments");
|
||||
}
|
||||
|
||||
static void
|
||||
geoip_print(const void *ip, const struct xt_entry_match *match, int numeric)
|
||||
{
|
||||
const struct xt_geoip_match_info *info = (void*)match->data;
|
||||
|
||||
u_int8_t i;
|
||||
|
||||
if (info->flags & XT_GEOIP_SRC)
|
||||
printf(" Source ");
|
||||
else
|
||||
printf(" Destination ");
|
||||
|
||||
if (info->count > 1)
|
||||
printf("countries: ");
|
||||
else
|
||||
printf("country: ");
|
||||
|
||||
if (info->flags & XT_GEOIP_INV)
|
||||
printf("! ");
|
||||
|
||||
for (i = 0; i < info->count; i++)
|
||||
printf("%s%c%c", i ? "," : "", COUNTRY(info->cc[i]));
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
static void
|
||||
geoip_save(const void *ip, const struct xt_entry_match *match)
|
||||
{
|
||||
@@ -295,6 +270,13 @@ geoip_save(const void *ip, const struct xt_entry_match *match)
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
static void
|
||||
geoip_print(const void *ip, const struct xt_entry_match *match, int numeric)
|
||||
{
|
||||
printf(" -m geoip");
|
||||
geoip_save(ip, match);
|
||||
}
|
||||
|
||||
static struct xtables_match geoip_match[] = {
|
||||
{
|
||||
.family = NFPROTO_IPV6,
|
||||
|
||||
Reference in New Issue
Block a user