netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: leroy christophe <christophe.leroy@c-s.fr>
Cc: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	GUITTON Alex <alex.guitton@c-s.fr>,
	Netfilter Development Mailing list
	<netfilter-devel@vger.kernel.org>
Subject: Re: bug : nft_redirect port byteorder issue
Date: Fri, 12 Dec 2014 16:40:35 +0000	[thread overview]
Message-ID: <20141212164034.GA3237@acer.localdomain> (raw)
In-Reply-To: <548B15DB.70707@c-s.fr>

On 12.12, leroy christophe wrote:
> Le 12/12/2014 16:25, Patrick McHardy a écrit :
> >On 12.12, leroy christophe wrote:
> >>Le 12/12/2014 12:55, Arturo Borrero Gonzalez a écrit :
> >>>On 12 December 2014 at 12:07, leroy christophe <christophe.leroy@c-s.fr> wrote:
> >>I'm not sure what I proposed it the correct patch, maybe it shall be fixed
> >>earlier in the chain, I don't know.
> >Yeah, I'm not so sure myself.
> >
> >Could you please try what happens if you do:
> >
> >... tcp dport 222 redir :tcp dport
> >
> >Which should redirect to the same port, but I'm interested if it
> >actually does that.
> >
> Without my patch, I get the following. Note the strange value in the DPT on
> the second line.
> 
> [   61.377273] redirIN=eth0 OUT=
> MAC=08:00:51:20:44:5b:08:00:27:fe:42:1e:08:00 SRC=172.25.231.37
> DST=172.25.231.5 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=29122 DF PROTO=TCP
> SPT=55626 DPT=222 WINDOW=14600 RES=0x00 SYN URGP=0
> [   61.377816] rejected IN=eth0 OUT=
> MAC=08:00:51:20:44:5b:08:00:27:fe:42:1e:08:00 SRC=172.25.231.37
> DST=172.25.231.5 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=29122 DF PROTO=TCP
> SPT=55626 DPT=20 WINDOW=14600 RES=0x00 SYN URGP=0

Strange, not sure why it is 20.

> With my patch, I get correct port.
> 
> [  511.994597] redirIN=eth0 OUT=
> MAC=08:00:51:20:44:5b:08:00:27:fe:42:1e:08:00 SRC=172.25.231.37
> DST=172.25.231.5 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=21300 DF PROTO=TCP
> SPT=55622 DPT=222 WINDOW=14600 RES=0x00 SYN URGP=0
> [  511.994999] rejected IN=eth0 OUT=
> MAC=08:00:51:20:44:5b:08:00:27:fe:42:1e:08:00 SRC=172.25.231.37
> DST=172.25.231.5 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=21300 DF PROTO=TCP
> SPT=55622 DPT=222 WINDOW=14600 RES=0x00 SYN URGP=0

Thanks! I'll have another look later, but it seems your patch is fine.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-12-12 16:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <54885B08.1010700@c-s.fr>
     [not found] ` <20141210182244.GA5622@salvia>
2014-12-12 10:16   ` bug : nft_redirect port byteorder issue leroy christophe
2014-12-12 10:49     ` Arturo Borrero Gonzalez
2014-12-12 11:07       ` leroy christophe
2014-12-12 11:55         ` Arturo Borrero Gonzalez
2014-12-12 12:55           ` leroy christophe
2014-12-12 15:25             ` Patrick McHardy
2014-12-12 16:20               ` leroy christophe
2014-12-12 16:40                 ` Patrick McHardy [this message]
2014-12-22 11:54     ` Pablo Neira Ayuso
2014-12-22 12:44       ` Patrick McHardy
2014-12-22 13:00         ` Pablo Neira Ayuso

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=20141212164034.GA3237@acer.localdomain \
    --to=kaber@trash.net \
    --cc=alex.guitton@c-s.fr \
    --cc=arturo.borrero.glez@gmail.com \
    --cc=christophe.leroy@c-s.fr \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@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;
as well as URLs for NNTP newsgroup(s).