Группа :: Система/Библиотеки
Пакет: opendpi
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: opendpi-netfilter-wrapper-1.1_2.6.35_v3.patch
Скачать
Скачать
diff -ur ./1/wrapper/ipt/libxt_opendpi.c ./2/wrapper/ipt/libxt_opendpi.c
--- ./1/wrapper/ipt/libxt_opendpi.c 2010-10-01 02:22:27.000000000 +0400
+++ ./2/wrapper/ipt/libxt_opendpi.c 2010-11-13 14:07:43.000000000 +0300
@@ -25,6 +25,8 @@
#include <arpa/inet.h>
#include <xtables.h>
+#include <linux/version.h>
+
#include "xt_opendpi.h"
static char *prot_long_str[] = { IPOQUE_PROTOCOL_LONG_STRING };
@@ -122,7 +124,11 @@
.version = XTABLES_VERSION,
.name = "opendpi",
.revision = 0,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
.family = AF_INET,
+#else
+ .family = NFPROTO_IPV4,
+#endif
.size = XT_ALIGN(sizeof(struct xt_opendpi_mtinfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_opendpi_mtinfo)),
.help = opendpi_mt_help,
diff -ur ./1/wrapper/src/main.c ./2/wrapper/src/main.c
--- ./1/wrapper/src/main.c 2010-11-04 12:18:48.000000000 +0300
+++ ./2/wrapper/src/main.c 2010-11-13 13:59:26.000000000 +0300
@@ -452,9 +452,12 @@
unsigned int protoff,
bool *hotdrop)
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
static bool
opendpi_mt(const struct sk_buff *skb, const struct xt_match_param *par)
+#else
+static bool
+opendpi_mt(const struct sk_buff *skb, struct xt_action_param *par)
#endif
{
u32 proto;
@@ -538,7 +541,7 @@
return nf_ct_l3proto_try_module_get (match->family) == 0;
}
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
static bool
opendpi_mt_check(const struct xt_mtchk_param *par)
{
@@ -553,6 +556,21 @@
return nf_ct_l3proto_try_module_get (par->family) == 0;
}
+#else
+static int
+opendpi_mt_check(const struct xt_mtchk_param *par)
+{
+ const struct xt_opendpi_mtinfo *info = par->matchinfo;
+
+ if (IPOQUE_BITMASK_IS_ZERO(info->flags)){
+ pr_info("None selected protocol.\n");
+ return -EINVAL;
+ }
+
+ opendpi_enable_protocols (info);
+
+ return nf_ct_l3proto_try_module_get (par->family);
+}
#endif