mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-05 20:26:38 +02:00
src: avoid use of _init
Xtables-addons's extensions will always be built as modules, so it is safe to use __attribute__((constructor)).
This commit is contained in:
@@ -106,8 +106,7 @@ static struct xtables_target chaos_tg_reg = {
|
||||
.extra_opts = chaos_tg_opts,
|
||||
};
|
||||
|
||||
void _init(void);
|
||||
void _init(void)
|
||||
static __attribute__((constructor)) void chaos_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&chaos_tg_reg);
|
||||
}
|
||||
|
@@ -41,8 +41,7 @@ static struct xtables_target delude_tg_reg = {
|
||||
.final_check = delude_tg_check,
|
||||
};
|
||||
|
||||
void _init(void);
|
||||
void _init(void)
|
||||
static __attribute__((constructor)) void delude_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&delude_tg_reg);
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ static struct xtables_target dhcpaddr_tg_reg = {
|
||||
.extra_opts = dhcpaddr_tg_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void dhcpaddr_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&dhcpaddr_tg_reg);
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ static struct xtables_target echo_tg_reg = {
|
||||
.final_check = echo_tg_check,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void echo_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&echo_tg_reg);
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ static int ipmark_tg_parse(int c, char **argv, int invert, unsigned int *flags,
|
||||
exit_error(PARAMETER_PROBLEM, "Bad addr value `%s' - should be `src' or `dst'", optarg);
|
||||
*flags |= FL_ADDR_USED;
|
||||
return true;
|
||||
|
||||
|
||||
case '2':
|
||||
param_act(P_ONLY_ONCE, "IPMARK", "and-mask", *flags & FL_AND_MASK_USED);
|
||||
param_act(P_NO_INVERT, "IPMARK", "and-mask", invert);
|
||||
@@ -175,7 +175,7 @@ static struct xtables_target ipmark_tg6_reg = {
|
||||
.extra_opts = ipmark_tg_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void ipmark_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&ipmark_tg4_reg);
|
||||
xtables_register_target(&ipmark_tg6_reg);
|
||||
|
@@ -111,8 +111,7 @@ static struct xtables_target logmark_tg_reg = {
|
||||
.extra_opts = logmark_tg_opts,
|
||||
};
|
||||
|
||||
void _init(void);
|
||||
void _init(void)
|
||||
static __attribute__((constructor)) void logmark_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&logmark_tg_reg);
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ static struct xtables_target sysrq_tg6_reg = {
|
||||
.final_check = sysrq_tg_check,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void sysrq_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&sysrq_tg4_reg);
|
||||
xtables_register_target(&sysrq_tg6_reg);
|
||||
|
@@ -32,7 +32,7 @@ static struct xtables_target tarpit_tg_reg = {
|
||||
.final_check = tarpit_tg_check,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void tarpit_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&tarpit_tg_reg);
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ static struct xtables_target tee_tg_reg = {
|
||||
.extra_opts = tee_tg_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void tee_tg_ldr(void)
|
||||
{
|
||||
xtables_register_target(&tee_tg_reg);
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ static struct xtables_match condition_mt_reg = {
|
||||
.extra_opts = condition_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void condition_mt_ldr(void)
|
||||
{
|
||||
xtables_register_match(&condition_mt_reg);
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ static struct xtables_match dhcpaddr_mt_reg = {
|
||||
.extra_opts = dhcpaddr_mt_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void dhcpaddr_mt_ldr(void)
|
||||
{
|
||||
xtables_register_match(&dhcpaddr_mt_reg);
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@ static struct xtables_match fuzzy_mt_reg = {
|
||||
.extra_opts = fuzzy_mt_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void fuzzy_mt_ldr(void)
|
||||
{
|
||||
xtables_register_match(&fuzzy_mt_reg);
|
||||
}
|
||||
|
@@ -272,7 +272,7 @@ static struct xtables_match geoip_match = {
|
||||
.extra_opts = geoip_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void geoip_mt_ldr(void)
|
||||
{
|
||||
xtables_register_match(&geoip_match);
|
||||
}
|
||||
|
@@ -242,7 +242,7 @@ static struct xtables_match ipp2p_mt_reg = {
|
||||
.extra_opts = ipp2p_mt_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void ipp2p_mt_ldr(void)
|
||||
{
|
||||
xtables_register_match(&ipp2p_mt_reg);
|
||||
}
|
||||
|
@@ -116,8 +116,7 @@ static struct xtables_match portscan_mt_reg = {
|
||||
.extra_opts = portscan_mt_opts,
|
||||
};
|
||||
|
||||
void _init(void);
|
||||
void _init(void)
|
||||
static __attribute__((constructor)) void portscan_mt_ldr(void)
|
||||
{
|
||||
xtables_register_match(&portscan_mt_reg);
|
||||
}
|
||||
|
@@ -133,7 +133,7 @@ static struct xtables_match quota_mt2_reg = {
|
||||
.extra_opts = quota_mt2_opts,
|
||||
};
|
||||
|
||||
static void _init(void)
|
||||
static __attribute__((constructor)) void quota2_mt_ldr(void)
|
||||
{
|
||||
xtables_register_match("a_mt2_reg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user