From: Gilles Kerdoncuff <gkerdoncuff.ext@orange-ftgroup.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: [PATCH] Update SNMP basic for full IP address NAT
Date: Thu, 23 Nov 2006 17:09:13 +0100 [thread overview]
Message-ID: <4565C7A9.1040500@orange-ftgroup.com> (raw)
In-Reply-To: <4565A6CC.1090404@trash.net>
Patrick McHardy wrote:
> Gilles Kerdoncuff wrote:
>
>> ** I understand that you'd like to keep the /8 behavior, yet, something
>> still troubles me with the current ip_nat_snmp_basic.c file :
>>
>> The from/to fields of the oct1_map structure are filled-in by calling
>> the NOCT1 (0xFF mask) macro on the tuple IP.
>> Which means that on a 192.168.1.x address, it takes the x part.
>>
>
> I'm confused - you seem to be right, but quick testing shows it behaves
> correctly and takes the 192 part.
>
>
This makes things clear. This is one of those little/big endian problems :
I'm using this module on a MIPS platform, you probably tested it on an
Intel architecture
If you look at ip_conntrack_ftp.c, it uses ntohl routine when extracting
the tuple IP. This is the way it should be done.
In the SNMP module, add ntohl after the
map.to = NOCT1(
and
map.from = NOCT1(
code lines
Run your quick test again, you will see that the bug is there !
I will fix that in my updated patch.
>> ** Anyway, if any use case for the /8 behavior exists, I don't mind
>> adding a parameter to test only the first 8,16,24 or 32 bits of the
>> address, keeping /8 as a default.
>>
>
> Please do so. But why only 8,16,24,32? I don't believe allowing
> any prefix len will be harder to do.
>
Ok, I'll do so as soon as I can find a few hours to code and test it.
Thanks a lot.
Gilles.
next prev parent reply other threads:[~2006-11-23 16:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 10:44 [PATCH] Update SNMP basic for full IP address NAT zze-Ganesh KERDONCUFF G ext RD-MAPS-REN
2006-11-15 6:45 ` Patrick McHardy
2006-11-16 15:05 ` Gilles Kerdoncuff
2006-11-23 13:49 ` Patrick McHardy
2006-11-23 16:09 ` Gilles Kerdoncuff [this message]
2006-11-23 16:15 ` Patrick McHardy
-- strict thread matches above, loose matches on Subject: below --
2006-11-02 17:38 zze-Ganesh KERDONCUFF G ext RD-MAPS-REN
2006-11-03 10:23 ` Patrick McHardy
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=4565C7A9.1040500@orange-ftgroup.com \
--to=gkerdoncuff.ext@orange-ftgroup.com \
--cc=kaber@trash.net \
--cc=netfilter-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.