Exemple #1
0
int load_mod_xt_set(void)
{
	struct sigaction act, old_act;
	bool res = true;

	/* Enable SIGCHLD since xtables_insmod forks/execs modprobe */
	act.sa_handler = SIG_DFL;
	sigemptyset(&act.sa_mask);
	act.sa_flags = 0;

	sigaction(SIGCHLD, &act, &old_act);

	if (xtables_insmod("xt_set", NULL, true))
		res = false;

	sigaction(SIGCHLD, &old_act, NULL);
	return res;
}
int xtables_load_ko(const char *modprobe, bool quiet)
{
	static bool loaded = false;
	int ret;

	if (loaded)
		return 0;

	if (proc_file_exists(afinfo->proc_exists)) {
		loaded = true;
		return 0;
	};

	ret = xtables_insmod(afinfo->kmod, modprobe, quiet);
	if (ret == 0)
		loaded = true;

	return ret;
}