Просмотр исходного кода

iptables: fix a segfault when iptables tries to use modprobe, force it to use insmod

SVN-Revision: 19827
Jo-Philipp Wich 16 лет назад
Родитель
Сommit
0ab4d7e848
2 измененных файлов с 24 добавлено и 0 удалено
  1. 4 0
      package/iptables/Makefile
  2. 20 0
      package/iptables/patches/020-iptables-force-modprobe-util.patch

+ 4 - 0
package/iptables/Makefile

@@ -254,6 +254,10 @@ TARGET_CPPFLAGS := \
 	-I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include \
 	-I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include \
 	$(TARGET_CPPFLAGS)
 	$(TARGET_CPPFLAGS)
 
 
+TARGET_CFLAGS := \
+	$(TARGET_CFLAGS) \
+	-DFORCE_MODPROBE_PROGRAM="\\\"/sbin/insmod\\\""
+
 CONFIGURE_ARGS += \
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-shared \
 	--enable-devel \
 	--enable-devel \

+ 20 - 0
package/iptables/patches/020-iptables-force-modprobe-util.patch

@@ -0,0 +1,20 @@
+--- a/xtables.c
++++ b/xtables.c
+@@ -285,6 +285,7 @@ void *xtables_realloc(void *ptr, size_t 
+ 
+ static char *get_modprobe(void)
+ {
++#ifndef FORCE_MODPROBE_PROGRAM
+ 	int procfile;
+ 	char *ret;
+ 
+@@ -309,6 +310,9 @@ static char *get_modprobe(void)
+ 	free(ret);
+ 	close(procfile);
+ 	return NULL;
++#else
++	return strdup(FORCE_MODPROBE_PROGRAM);
++#endif
+ }
+ 
+ int xtables_insmod(const char *modname, const char *modprobe, bool quiet)