From 1eb0081027ee567e822b24377ea614e66c408ff2 Mon Sep 17 00:00:00 2001 From: Martin Josefsson Date: Wed, 26 May 2004 15:58:07 +0000 Subject: Fix 64bit kernel / 32bit userspace issue. Sync header with kernel. --- extensions/libipt_SAME.c | 3 ++- extensions/libipt_ULOG.c | 30 ++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) (limited to 'extensions') diff --git a/extensions/libipt_SAME.c b/extensions/libipt_SAME.c index e9c42a80..52a7e728 100644 --- a/extensions/libipt_SAME.c +++ b/extensions/libipt_SAME.c @@ -7,7 +7,8 @@ #include #include #include -#include +/* For 64bit kernel / 32bit userspace */ +#include "../include/linux/netfilter_ipv4/ipt_SAME.h" /* Function which prints out usage message. */ static void diff --git a/extensions/libipt_ULOG.c b/extensions/libipt_ULOG.c index 41ee9911..53719116 100644 --- a/extensions/libipt_ULOG.c +++ b/extensions/libipt_ULOG.c @@ -17,10 +17,8 @@ #include #include #include -#include - -#define ULOG_DEFAULT_NLGROUP 1 -#define ULOG_DEFAULT_QTHRESHOLD 1 +/* For 64bit kernel / 32bit userspace */ +#include "../include/linux/netfilter_ipv4/ipt_ULOG.h" void print_groups(unsigned int gmask) @@ -124,7 +122,11 @@ static int parse(int c, char **argv, int invert, unsigned int *flags, if (atoi(optarg) < 0) exit_error(PARAMETER_PROBLEM, "Negative copy range?"); +#ifdef KERNEL_64_USERSPACE_32 + loginfo->copy_range = (unsigned long long)atoll(optarg); +#else loginfo->copy_range = atoi(optarg); +#endif *flags |= IPT_LOG_OPT_CPRANGE; break; case 'B': @@ -137,7 +139,11 @@ static int parse(int c, char **argv, int invert, unsigned int *flags, if (atoi(optarg) > ULOG_MAX_QLEN) exit_error(PARAMETER_PROBLEM, "Maximum queue length exceeded"); +#ifdef KERNEL_64_USERSPACE_32 + loginfo->qthreshold = (unsigned long long)atoll(optarg); +#else loginfo->qthreshold = atoi(optarg); +#endif *flags |= IPT_LOG_OPT_QTHRESHOLD; break; } @@ -163,11 +169,19 @@ static void save(const struct ipt_ip *ip, printf("--ulog-nlgroup "); print_groups(loginfo->nl_group); } +#ifdef KERNEL_64_USERSPACE_32 + if (loginfo->copy_range) + printf("--ulog-cprange %llu ", loginfo->copy_range); + + if (loginfo->qthreshold != ULOG_DEFAULT_QTHRESHOLD) + printf("--ulog-qthreshold %llu ", loginfo->qthreshold); +#else if (loginfo->copy_range) printf("--ulog-cprange %d ", loginfo->copy_range); if (loginfo->qthreshold != ULOG_DEFAULT_QTHRESHOLD) printf("--ulog-qthreshold %d ", loginfo->qthreshold); +#endif } /* Prints out the targinfo. */ @@ -179,11 +193,19 @@ print(const struct ipt_ip *ip, = (const struct ipt_ulog_info *) target->data; printf("ULOG "); +#ifdef KERNEL_64_USERSPACE_32 + printf("copy_range %llu nlgroup ", loginfo->copy_range); +#else printf("copy_range %d nlgroup ", loginfo->copy_range); +#endif print_groups(loginfo->nl_group); if (strcmp(loginfo->prefix, "") != 0) printf("prefix `%s' ", loginfo->prefix); +#ifdef KERNEL_64_USERSPACE_32 + printf("queue_threshold %llu ", loginfo->qthreshold); +#else printf("queue_threshold %d ", loginfo->qthreshold); +#endif } static -- cgit v1.2.3