Browse Source

squeeze fixes

git.mgm/mediaproxy-ng/2.0
Richard Fuchs 15 years ago
parent
commit
81daf8b569
2 changed files with 13 additions and 9 deletions
  1. +6
    -6
      iptables-extension/libipt_MEDIAPROXY-1.4.c
  2. +7
    -3
      kernel-module/ipt_MEDIAPROXY.c

+ 6
- 6
iptables-extension/libipt_MEDIAPROXY-1.4.c View File

@ -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,


+ 7
- 3
kernel-module/ipt_MEDIAPROXY.c View File

@ -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;
}


Loading…
Cancel
Save