Skip to content

Commit e256544

Browse files
Tomaz Zamanigorpecovnik
authored andcommitted
gateway-dk-ask: fix xtables extension init — use -D_INIT (uppercase)
The xtables header (xtables.h) has: #ifdef _INIT # define _init __attribute__((constructor)) _INIT #endif When -D_INIT=libxt_<name>_init (uppercase) is defined, the header chains _init → __attribute__((constructor)) _INIT → libxt_<name>_init. The constructor attribute makes dlopen() automatically call the init function, which registers the target with xtables_register_target(). Our build was using -D_init (lowercase) which directly renamed the symbol but bypassed the header's #ifdef _INIT block, so the constructor attribute was never applied. The extension loaded but _init was never called, leaving options unregistered. This matches how iptables itself builds extensions (Makefile.am uses -D_INIT=lib$*_init).
1 parent 0b693fa commit e256544

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extensions/gateway-dk-ask.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function pre_customize_image__001_build_ask_userspace() {
283283
chroot_sdcard "cd /tmp/ask-userspace/iptables-extensions && \
284284
for name in ${ask_xtables_modules[*]}; do \
285285
gcc -shared -fPIC -O2 \
286-
-D_init=\${name}_init \
286+
-D_INIT=\${name}_init \
287287
-I./include \
288288
-o \"\${name}.so\" \"\${name}.c\" || exit 1; \
289289
done && \

0 commit comments

Comments
 (0)