Commit e256544
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
0 commit comments