diff options
Diffstat (limited to 'extensions/libipt_realm.c')
-rw-r--r-- | extensions/libipt_realm.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/extensions/libipt_realm.c b/extensions/libipt_realm.c index 8eea7874..75009105 100644 --- a/extensions/libipt_realm.c +++ b/extensions/libipt_realm.c @@ -28,18 +28,10 @@ static const struct xt_option_entry realm_opts[] = { XTOPT_TABLEEND, }; -/* array of realms from /etc/iproute2/rt_realms */ +static const char f_realms[] = "/etc/iproute2/rt_realms"; +/* array of realms from f_realms[] */ static struct xtables_lmap *realms; -static void realm_init(struct xt_entry_match *m) -{ - const char file[] = "/etc/iproute2/rt_realms"; - - realms = xtables_lmap_init(file); - if (realms == NULL && errno != ENOENT) - fprintf(stderr, "Warning: %s: %s\n", file, strerror(errno)); -} - static void realm_parse(struct xt_option_call *cb) { struct xt_realm_info *realminfo = cb->data; @@ -151,7 +143,6 @@ static struct xtables_match realm_mt_reg = { .size = XT_ALIGN(sizeof(struct xt_realm_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_realm_info)), .help = realm_help, - .init = realm_init, .print = realm_print, .save = realm_save, .x6_parse = realm_parse, @@ -161,5 +152,10 @@ static struct xtables_match realm_mt_reg = { void _init(void) { + realms = xtables_lmap_init(f_realms); + if (realms == NULL && errno != ENOENT) + fprintf(stderr, "Warning: %s: %s\n", f_realms, + strerror(errno)); + xtables_register_match(&realm_mt_reg); } |