diff options
author | Martin Josefsson <gandalf@wlug.westbo.se> | 2004-05-26 15:58:07 +0000 |
---|---|---|
committer | Martin Josefsson <gandalf@wlug.westbo.se> | 2004-05-26 15:58:07 +0000 |
commit | 1eb0081027ee567e822b24377ea614e66c408ff2 (patch) | |
tree | 37c3d4dafd4a06e38a554207890185404933d2ed /extensions/libipt_ULOG.c | |
parent | b105bc9f4bf61ffa835950c3d4e4b6162e1e16f8 (diff) |
Fix 64bit kernel / 32bit userspace issue.
Sync header with kernel.
Diffstat (limited to 'extensions/libipt_ULOG.c')
-rw-r--r-- | extensions/libipt_ULOG.c | 30 |
1 files changed, 26 insertions, 4 deletions
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 <getopt.h> #include <iptables.h> #include <linux/netfilter_ipv4/ip_tables.h> -#include <linux/netfilter_ipv4/ipt_ULOG.h> - -#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 |