Skip to content

Commit 0d008a9

Browse files
committed
fix compatibility with new xtables
1 parent a1e3687 commit 0d008a9

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

ipthelper/ip6tables.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,12 @@ static void command_match(struct iptables_command_state *cs)
14241424
"unexpected ! flag before --match");
14251425

14261426
m = xtables_find_match(optarg, XTF_LOAD_MUST_SUCCEED, &cs->matches);
1427+
if (m == NULL) {
1428+
xtables_error(PARAMETER_PROBLEM,
1429+
"unable to load match module %s",
1430+
optarg);
1431+
return;
1432+
}
14271433
size = XT_ALIGN(sizeof(struct xt_entry_match)) + m->size;
14281434
m->m = xtables_calloc(1, size);
14291435
m->m->u.match_size = size;
@@ -1463,6 +1469,10 @@ static void command_match(struct iptables_command_state *cs)
14631469
}
14641470

14651471

1472+
EXPORT void* set_modprobe(const char* program) {
1473+
xtables_modprobe_program = program;
1474+
}
1475+
14661476
EXPORT void* init_handle6(const char* table){
14671477
const char* err;
14681478
void* handle = ip6tc_init(table);

ipthelper/iptables.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ struct xtables_globals iptables_globals = {
148148
.program_version = "1.1.1",
149149
.orig_opts = original_opts,
150150
.opts = NULL,
151+
#if XTABLES_VERSION_CODE >= 11
152+
.compat_rev = xtables_compatible_revision,
153+
#endif
151154
.exit_err = iptables_exit_error
152155
};
153156

ipthelper/ipthelper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern "C" {
3030
extern EXPORT void* init_handle6(const char* table);
3131
extern EXPORT char* ipth_bpf_compile(const char* dltname, const char* program, int length);
3232
extern EXPORT void ipth_free(void* ptr);
33+
extern EXPORT void* set_modprobe(const char* program);
3334
#ifdef __cplusplus
3435
}
3536
#endif

0 commit comments

Comments
 (0)