|
|
05e71a |
From 22476c0758b930b972c5397ee3ba1bef5ccf6223 Mon Sep 17 00:00:00 2001
|
|
|
05e71a |
From: Jan Engelhardt <jengelh@inai.de>
|
|
|
05e71a |
Date: Wed, 27 Jun 2018 11:50:41 +0200
|
|
|
05e71a |
Subject: [PATCH] extensions: use __attribute__((constructor)) for
|
|
|
05e71a |
autoregistration
|
|
|
05e71a |
|
|
|
05e71a |
The ebtables initialization is easier, and, judging from the "static"
|
|
|
05e71a |
recipe in Makefile, that calling ebt_*_register ahead of main is
|
|
|
05e71a |
safe.
|
|
|
05e71a |
|
|
|
05e71a |
This means that a static build won't need the pseudomain hack,
|
|
|
05e71a |
and that -nostartfiles can also go away.
|
|
|
05e71a |
|
|
|
05e71a |
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
|
05e71a |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
05e71a |
---
|
|
|
05e71a |
Makefile | 34 +---------------------------------
|
|
|
05e71a |
extensions/Makefile | 4 ++--
|
|
|
05e71a |
extensions/ebt_802_3.c | 2 +-
|
|
|
05e71a |
extensions/ebt_among.c | 2 +-
|
|
|
05e71a |
extensions/ebt_arp.c | 2 +-
|
|
|
05e71a |
extensions/ebt_arpreply.c | 2 +-
|
|
|
05e71a |
extensions/ebt_ip.c | 2 +-
|
|
|
05e71a |
extensions/ebt_ip6.c | 2 +-
|
|
|
05e71a |
extensions/ebt_limit.c | 2 +-
|
|
|
05e71a |
extensions/ebt_log.c | 2 +-
|
|
|
05e71a |
extensions/ebt_mark.c | 2 +-
|
|
|
05e71a |
extensions/ebt_mark_m.c | 2 +-
|
|
|
05e71a |
extensions/ebt_nat.c | 2 +-
|
|
|
05e71a |
extensions/ebt_nflog.c | 2 +-
|
|
|
05e71a |
extensions/ebt_pkttype.c | 2 +-
|
|
|
05e71a |
extensions/ebt_redirect.c | 2 +-
|
|
|
05e71a |
extensions/ebt_standard.c | 2 +-
|
|
|
05e71a |
extensions/ebt_stp.c | 2 +-
|
|
|
05e71a |
extensions/ebt_string.c | 2 +-
|
|
|
05e71a |
extensions/ebt_ulog.c | 2 +-
|
|
|
05e71a |
extensions/ebt_vlan.c | 2 +-
|
|
|
05e71a |
extensions/ebtable_broute.c | 2 +-
|
|
|
05e71a |
extensions/ebtable_filter.c | 2 +-
|
|
|
05e71a |
extensions/ebtable_nat.c | 2 +-
|
|
|
05e71a |
include/ebtables_u.h | 2 ++
|
|
|
05e71a |
25 files changed, 27 insertions(+), 57 deletions(-)
|
|
|
05e71a |
|
|
|
05e71a |
diff --git a/Makefile b/Makefile
|
|
|
05e71a |
index 7c70db0267983..4d7b10f4916d6 100644
|
|
|
05e71a |
--- a/Makefile
|
|
|
05e71a |
+++ b/Makefile
|
|
|
05e71a |
@@ -116,39 +116,7 @@ daemon: ebtablesd ebtablesu
|
|
|
05e71a |
# a little scripting for a static binary, making one for ebtables-restore
|
|
|
05e71a |
# should be completely analogous
|
|
|
05e71a |
static: extensions/ebt_*.c extensions/ebtable_*.c ebtables.c communication.c ebtables-standalone.c getethertype.c libebtc.c useful_functions.c
|
|
|
05e71a |
- cp ebtables-standalone.c ebtables-standalone.c_ ; \
|
|
|
05e71a |
- cp include/ebtables_u.h include/ebtables_u.h_ ; \
|
|
|
05e71a |
- sed "s/ main(/ pseudomain(/" ebtables-standalone.c > ebtables-standalone.c__ ; \
|
|
|
05e71a |
- mv ebtables-standalone.c__ ebtables-standalone.c ; \
|
|
|
05e71a |
- printf "\nint main(int argc, char *argv[])\n{\n " >> ebtables-standalone.c ; \
|
|
|
05e71a |
- for arg in $(EXT_FUNC) \
|
|
|
05e71a |
- ; do \
|
|
|
05e71a |
- sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \
|
|
|
05e71a |
- mv extensions/ebt_$${arg}.c_ extensions/ebt_$${arg}.c ; \
|
|
|
05e71a |
- printf "\t%s();\n" _$${arg}_init >> ebtables-standalone.c ; \
|
|
|
05e71a |
- printf "extern void %s();\n" _$${arg}_init >> include/ebtables_u.h ; \
|
|
|
05e71a |
- done ; \
|
|
|
05e71a |
- for arg in $(EXT_TABLES) \
|
|
|
05e71a |
- ; do \
|
|
|
05e71a |
- sed s/_init/_t_$${arg}_init/ extensions/ebtable_$${arg}.c > extensions/ebtable_$${arg}.c_ ; \
|
|
|
05e71a |
- mv extensions/ebtable_$${arg}.c_ extensions/ebtable_$${arg}.c ; \
|
|
|
05e71a |
- printf "\t%s();\n" _t_$${arg}_init >> ebtables-standalone.c ; \
|
|
|
05e71a |
- printf "extern void %s();\n" _t_$${arg}_init >> include/ebtables_u.h ; \
|
|
|
05e71a |
- done ; \
|
|
|
05e71a |
- printf "\n\tpseudomain(argc, argv);\n\treturn 0;\n}\n" >> ebtables-standalone.c ;\
|
|
|
05e71a |
- $(CC) $(CFLAGS) $(LDFLAGS) $(PROGSPECS) -o $@ $^ -I$(KERNEL_INCLUDES) -Iinclude ; \
|
|
|
05e71a |
- for arg in $(EXT_FUNC) \
|
|
|
05e71a |
- ; do \
|
|
|
05e71a |
- sed "s/ .*_init/ _init/" extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \
|
|
|
05e71a |
- mv extensions/ebt_$${arg}.c_ extensions/ebt_$${arg}.c ; \
|
|
|
05e71a |
- done ; \
|
|
|
05e71a |
- for arg in $(EXT_TABLES) \
|
|
|
05e71a |
- ; do \
|
|
|
05e71a |
- sed "s/ .*_init/ _init/" extensions/ebtable_$${arg}.c > extensions/ebtable_$${arg}.c_ ; \
|
|
|
05e71a |
- mv extensions/ebtable_$${arg}.c_ extensions/ebtable_$${arg}.c ; \
|
|
|
05e71a |
- done ; \
|
|
|
05e71a |
- mv ebtables-standalone.c_ ebtables-standalone.c ; \
|
|
|
05e71a |
- mv include/ebtables_u.h_ include/ebtables_u.h
|
|
|
05e71a |
+ $(CC) $(CFLAGS) $(LDFLAGS) $(PROGSPECS) -o $@ $^ -I$(KERNEL_INCLUDES) -Iinclude
|
|
|
05e71a |
|
|
|
05e71a |
tmp1:=$(shell printf $(BINDIR) | sed 's/\//\\\//g')
|
|
|
05e71a |
tmp2:=$(shell printf $(SYSCONFIGDIR) | sed 's/\//\\\//g')
|
|
|
05e71a |
diff --git a/extensions/Makefile b/extensions/Makefile
|
|
|
05e71a |
index 60a70a2298357..daa11fce36e5e 100644
|
|
|
05e71a |
--- a/extensions/Makefile
|
|
|
05e71a |
+++ b/extensions/Makefile
|
|
|
05e71a |
@@ -11,13 +11,13 @@ EXT_LIBSI+=$(foreach T,$(EXT_FUNC), -lebt_$(T))
|
|
|
05e71a |
EXT_LIBSI+=$(foreach T,$(EXT_TABLES), -lebtable_$(T))
|
|
|
05e71a |
|
|
|
05e71a |
extensions/ebt_%.so: extensions/ebt_%.o
|
|
|
05e71a |
- $(CC) $(LDFLAGS) -shared -o $@ -lc $< -nostartfiles
|
|
|
05e71a |
+ $(CC) $(LDFLAGS) -shared -o $@ -lc $<
|
|
|
05e71a |
|
|
|
05e71a |
extensions/libebt_%.so: extensions/ebt_%.so
|
|
|
05e71a |
mv $< $@
|
|
|
05e71a |
|
|
|
05e71a |
extensions/ebtable_%.so: extensions/ebtable_%.o
|
|
|
05e71a |
- $(CC) $(LDFLAGS) -shared -o $@ -lc $< -nostartfiles
|
|
|
05e71a |
+ $(CC) $(LDFLAGS) -shared -o $@ -lc $<
|
|
|
05e71a |
|
|
|
05e71a |
extensions/libebtable_%.so: extensions/ebtable_%.so
|
|
|
05e71a |
mv $< $@
|
|
|
05e71a |
diff --git a/extensions/ebt_802_3.c b/extensions/ebt_802_3.c
|
|
|
05e71a |
index 458484939231d..d70fd441e60db 100644
|
|
|
05e71a |
--- a/extensions/ebt_802_3.c
|
|
|
05e71a |
+++ b/extensions/ebt_802_3.c
|
|
|
05e71a |
@@ -141,7 +141,7 @@ static struct ebt_u_match _802_3_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&_802_3_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_among.c b/extensions/ebt_among.c
|
|
|
05e71a |
index e4fc5ac22a005..b1560e8f09e8d 100644
|
|
|
05e71a |
--- a/extensions/ebt_among.c
|
|
|
05e71a |
+++ b/extensions/ebt_among.c
|
|
|
05e71a |
@@ -491,7 +491,7 @@ static struct ebt_u_match among_match = {
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&among_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_arp.c b/extensions/ebt_arp.c
|
|
|
05e71a |
index b2819553ab313..84b6e900eff62 100644
|
|
|
05e71a |
--- a/extensions/ebt_arp.c
|
|
|
05e71a |
+++ b/extensions/ebt_arp.c
|
|
|
05e71a |
@@ -362,7 +362,7 @@ static struct ebt_u_match arp_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&arp_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_arpreply.c b/extensions/ebt_arpreply.c
|
|
|
05e71a |
index 51eda66adbff3..399868bdd9059 100644
|
|
|
05e71a |
--- a/extensions/ebt_arpreply.c
|
|
|
05e71a |
+++ b/extensions/ebt_arpreply.c
|
|
|
05e71a |
@@ -133,7 +133,7 @@ static struct ebt_u_target arpreply_target =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_target(&arpreply_target);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_ip.c b/extensions/ebt_ip.c
|
|
|
05e71a |
index 1ffdb95f156df..faffade35f7f1 100644
|
|
|
05e71a |
--- a/extensions/ebt_ip.c
|
|
|
05e71a |
+++ b/extensions/ebt_ip.c
|
|
|
05e71a |
@@ -472,7 +472,7 @@ static struct ebt_u_match ip_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&ip_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
|
|
|
05e71a |
index 347797b4afe18..17a4303177284 100644
|
|
|
05e71a |
--- a/extensions/ebt_ip6.c
|
|
|
05e71a |
+++ b/extensions/ebt_ip6.c
|
|
|
05e71a |
@@ -413,7 +413,7 @@ static struct ebt_u_match ip6_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&ip6_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_limit.c b/extensions/ebt_limit.c
|
|
|
05e71a |
index 2cbf4dee51fb4..1fe9d84ffd137 100644
|
|
|
05e71a |
--- a/extensions/ebt_limit.c
|
|
|
05e71a |
+++ b/extensions/ebt_limit.c
|
|
|
05e71a |
@@ -212,7 +212,7 @@ static struct ebt_u_match limit_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&limit_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_log.c b/extensions/ebt_log.c
|
|
|
05e71a |
index 97d50919d25ca..b5d32321948c8 100644
|
|
|
05e71a |
--- a/extensions/ebt_log.c
|
|
|
05e71a |
+++ b/extensions/ebt_log.c
|
|
|
05e71a |
@@ -217,7 +217,7 @@ static struct ebt_u_watcher log_watcher =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_watcher(&log_watcher);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_mark.c b/extensions/ebt_mark.c
|
|
|
05e71a |
index 4cf1378d5085c..b4f93b5960b6a 100644
|
|
|
05e71a |
--- a/extensions/ebt_mark.c
|
|
|
05e71a |
+++ b/extensions/ebt_mark.c
|
|
|
05e71a |
@@ -172,7 +172,7 @@ static struct ebt_u_target mark_target =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_target(&mark_target);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_mark_m.c b/extensions/ebt_mark_m.c
|
|
|
05e71a |
index 7561f059c0108..b6d11a2903bbe 100644
|
|
|
05e71a |
--- a/extensions/ebt_mark_m.c
|
|
|
05e71a |
+++ b/extensions/ebt_mark_m.c
|
|
|
05e71a |
@@ -121,7 +121,7 @@ static struct ebt_u_match mark_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&mark_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_nat.c b/extensions/ebt_nat.c
|
|
|
05e71a |
index 00d9cd4083247..fe7e9875498e0 100644
|
|
|
05e71a |
--- a/extensions/ebt_nat.c
|
|
|
05e71a |
+++ b/extensions/ebt_nat.c
|
|
|
05e71a |
@@ -231,7 +231,7 @@ static struct ebt_u_target dnat_target =
|
|
|
05e71a |
.extra_ops = opts_d,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_target(&snat_target);
|
|
|
05e71a |
ebt_register_target(&dnat_target);
|
|
|
05e71a |
diff --git a/extensions/ebt_nflog.c b/extensions/ebt_nflog.c
|
|
|
05e71a |
index 405673a01f893..04c547d06cee0 100644
|
|
|
05e71a |
--- a/extensions/ebt_nflog.c
|
|
|
05e71a |
+++ b/extensions/ebt_nflog.c
|
|
|
05e71a |
@@ -166,7 +166,7 @@ static struct ebt_u_watcher nflog_watcher = {
|
|
|
05e71a |
.extra_ops = nflog_opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_watcher(&nflog_watcher);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_pkttype.c b/extensions/ebt_pkttype.c
|
|
|
05e71a |
index 486c85c3c3faf..bf578fcf98f92 100644
|
|
|
05e71a |
--- a/extensions/ebt_pkttype.c
|
|
|
05e71a |
+++ b/extensions/ebt_pkttype.c
|
|
|
05e71a |
@@ -125,7 +125,7 @@ static struct ebt_u_match pkttype_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&pkttype_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_redirect.c b/extensions/ebt_redirect.c
|
|
|
05e71a |
index 3f8227a917583..59fe818f7b205 100644
|
|
|
05e71a |
--- a/extensions/ebt_redirect.c
|
|
|
05e71a |
+++ b/extensions/ebt_redirect.c
|
|
|
05e71a |
@@ -108,7 +108,7 @@ static struct ebt_u_target redirect_target =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_target(&redirect_target);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_standard.c b/extensions/ebt_standard.c
|
|
|
05e71a |
index 81edead71a840..f3c33086bac53 100644
|
|
|
05e71a |
--- a/extensions/ebt_standard.c
|
|
|
05e71a |
+++ b/extensions/ebt_standard.c
|
|
|
05e71a |
@@ -84,7 +84,7 @@ static struct ebt_u_target standard =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_target(&standard);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_stp.c b/extensions/ebt_stp.c
|
|
|
05e71a |
index 5c5fc3334311d..311bc63d2cb0c 100644
|
|
|
05e71a |
--- a/extensions/ebt_stp.c
|
|
|
05e71a |
+++ b/extensions/ebt_stp.c
|
|
|
05e71a |
@@ -337,7 +337,7 @@ static struct ebt_u_match stp_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&stp_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_string.c b/extensions/ebt_string.c
|
|
|
05e71a |
index 7d24f8002f4d7..97fbe19eca54f 100644
|
|
|
05e71a |
--- a/extensions/ebt_string.c
|
|
|
05e71a |
+++ b/extensions/ebt_string.c
|
|
|
05e71a |
@@ -312,7 +312,7 @@ static struct ebt_u_match string_match =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&string_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_ulog.c b/extensions/ebt_ulog.c
|
|
|
05e71a |
index 54eec53f7069f..72a6c8b199b42 100644
|
|
|
05e71a |
--- a/extensions/ebt_ulog.c
|
|
|
05e71a |
+++ b/extensions/ebt_ulog.c
|
|
|
05e71a |
@@ -180,7 +180,7 @@ static struct ebt_u_watcher ulog_watcher =
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_watcher(&ulog_watcher);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebt_vlan.c b/extensions/ebt_vlan.c
|
|
|
05e71a |
index 0a37067b5ebde..0818d48e8521b 100644
|
|
|
05e71a |
--- a/extensions/ebt_vlan.c
|
|
|
05e71a |
+++ b/extensions/ebt_vlan.c
|
|
|
05e71a |
@@ -181,7 +181,7 @@ static struct ebt_u_match vlan_match = {
|
|
|
05e71a |
.extra_ops = opts,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_match(&vlan_match);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebtable_broute.c b/extensions/ebtable_broute.c
|
|
|
05e71a |
index 5259355e2b01b..c106f0825a147 100644
|
|
|
05e71a |
--- a/extensions/ebtable_broute.c
|
|
|
05e71a |
+++ b/extensions/ebtable_broute.c
|
|
|
05e71a |
@@ -23,7 +23,7 @@ ebt_u_table table =
|
|
|
05e71a |
.help = print_help,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_table(&table);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebtable_filter.c b/extensions/ebtable_filter.c
|
|
|
05e71a |
index e41fb84ffbf20..c0bf105d75986 100644
|
|
|
05e71a |
--- a/extensions/ebtable_filter.c
|
|
|
05e71a |
+++ b/extensions/ebtable_filter.c
|
|
|
05e71a |
@@ -29,7 +29,7 @@ static struct ebt_u_table table =
|
|
|
05e71a |
.help = print_help,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_table(&table);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/extensions/ebtable_nat.c b/extensions/ebtable_nat.c
|
|
|
05e71a |
index b21c9ddaedd46..ee044823866c3 100644
|
|
|
05e71a |
--- a/extensions/ebtable_nat.c
|
|
|
05e71a |
+++ b/extensions/ebtable_nat.c
|
|
|
05e71a |
@@ -30,7 +30,7 @@ ebt_u_table table =
|
|
|
05e71a |
.help = print_help,
|
|
|
05e71a |
};
|
|
|
05e71a |
|
|
|
05e71a |
-void _init(void)
|
|
|
05e71a |
+static void _INIT(void)
|
|
|
05e71a |
{
|
|
|
05e71a |
ebt_register_table(&table);
|
|
|
05e71a |
}
|
|
|
05e71a |
diff --git a/include/ebtables_u.h b/include/ebtables_u.h
|
|
|
05e71a |
index 3235bf5967055..7f5968dc6f39d 100644
|
|
|
05e71a |
--- a/include/ebtables_u.h
|
|
|
05e71a |
+++ b/include/ebtables_u.h
|
|
|
05e71a |
@@ -44,6 +44,8 @@
|
|
|
05e71a |
#define EBT_ALIGN(s) (((s) + (EBT_MIN_ALIGN-1)) & ~(EBT_MIN_ALIGN-1))
|
|
|
05e71a |
#define ERRORMSG_MAXLEN 128
|
|
|
05e71a |
|
|
|
05e71a |
+#define _INIT __attribute__((constructor)) _init
|
|
|
05e71a |
+
|
|
|
05e71a |
struct ebt_u_entries
|
|
|
05e71a |
{
|
|
|
05e71a |
int policy;
|
|
|
05e71a |
--
|
|
|
05e71a |
2.21.0
|
|
|
05e71a |
|