diff --git a/iptables-extension/libipt_MEDIAPROXY-1.4.c b/iptables-extension/libipt_MEDIAPROXY-1.4.c index d44dfbcbe..799ebc7f4 100644 --- a/iptables-extension/libipt_MEDIAPROXY-1.4.c +++ b/iptables-extension/libipt_MEDIAPROXY-1.4.c @@ -26,7 +26,7 @@ static int parse(int c, const void *entry, struct xt_entry_target **target) { - struct ipt_mediaproxy_info *info = (void *) *target; + struct ipt_mediaproxy_info *info = (void *) (*target)->data; if (c == '1') { info->id = atoi(optarg); @@ -41,17 +41,17 @@ static int parse(int c, static void final_check(unsigned int flags) { if (!flags) - exit_error(PARAMETER_PROBLEM, "You must specify --id"); + xtables_error(PARAMETER_PROBLEM, "You must specify --id"); } static void print(const void *ip, const struct xt_entry_target *target, int numeric) { - struct ipt_mediaproxy_info *info = (void *) target; + struct ipt_mediaproxy_info *info = (void *) target->data; printf("id %u", info->id); } static void save(const void *ip, const struct xt_entry_target *target) { - struct ipt_mediaproxy_info *info = (void *) target; + struct ipt_mediaproxy_info *info = (void *) target->data; printf("--id %u", info->id); } @@ -64,8 +64,8 @@ static struct option opts[] = { static struct xtables_target mediaproxy = { .name = "MEDIAPROXY", - .family = AF_INET, - .version = "1.4.2", + .family = NFPROTO_IPV4, + .version = XTABLES_VERSION, .size = XT_ALIGN(sizeof(struct ipt_mediaproxy_info)), .userspacesize = XT_ALIGN(sizeof(struct ipt_mediaproxy_info)), .help = help, diff --git a/kernel-module/ipt_MEDIAPROXY.c b/kernel-module/ipt_MEDIAPROXY.c index 468f20c83..058083451 100644 --- a/kernel-module/ipt_MEDIAPROXY.c +++ b/kernel-module/ipt_MEDIAPROXY.c @@ -1112,22 +1112,26 @@ skip: #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) +#define CHECK_ERR false +#define CHECK_SCC true static bool check(const struct xt_tgchk_param *par) { #else +#define CHECK_ERR -EINVAL +#define CHECK_SCC 0 static int check(const struct xt_tgchk_param *par) { #endif const struct ipt_mediaproxy_info *pinfo = par->targinfo; if (!my_proc_root) { printk(KERN_WARNING "ipt_MEDIAPROXY check() without proc_root\n"); - return 0; + return CHECK_ERR; } if (pinfo->id >= MAX_ID) { printk(KERN_WARNING "ipt_MEDIAPROXY ID too high (%u >= %u)\n", pinfo->id, MAX_ID); - return 0; + return CHECK_ERR; } - return 1; + return CHECK_SCC; }