Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Eric Crossman <eric.crossman@critical.com>
To: netfilter list <netfilter@lists.netfilter.org>
Subject: MARK target with unsigned long
Date: Fri, 05 Sep 2003 11:25:03 -0400	[thread overview]
Message-ID: <3F58AACF.2060503@critical.com> (raw)

Has anyone run across a problem trying to use the high order bits in 
MARKing packets (i.e. 0xffffffff)? The fwmark seems to be using a signed 
long opposed to an unsigned long with limits the highest allowable value 
to 0x7fffffff. I have created the following patch which uses an unsigned 
long. Is this a legitimate fix that won't interfere with other parts of 
the iptables code?

diff -Naur iptables-1.2.8.orig/iptables.c iptables-1.2.8/iptables.c
--- iptables-1.2.8.orig/iptables.c      2003-03-31 07:11:55.000000000 -0500
+++ iptables-1.2.8/iptables.c   2003-08-30 16:08:05.000000000 -0400
@@ -889,12 +889,12 @@
 string_to_number(const char *s, unsigned int min, unsigned int max,
                 unsigned int *ret)
 {
-       long number;
+       unsigned long number;
        char *end;
 
        /* Handle hex, octal, etc. */
        errno = 0;
-       number = strtol(s, &end, 0);
+       number = strtoul(s, &end, 0);
        if (*end == '\0' && end != s) {
                /* we parsed a number, let's see if we want this */
                if (errno != ERANGE && min <= number && number <= max) {

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Eric Crossman <eric.crossman@critical.com>
Critical Technologies Inc.
1001 Broad St., Suite 400
Utica, NY 13501



                 reply	other threads:[~2003-09-05 15:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F58AACF.2060503@critical.com \
    --to=eric.crossman@critical.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox