All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gerd v. Egidy" <lists@egidy.de>
To: hadi@cyberus.ca
Cc: netdev@vger.kernel.org,
	Netfilter Development Mailinglist
	<netfilter-devel@lists.netfilter.org>
Subject: -j MARK in raw vs. mangle (was Re: xfrm by MARK: tcp problems when mark for in and out differ)
Date: Thu, 14 Oct 2010 16:14:12 +0200	[thread overview]
Message-ID: <201010141614.12940.lists@egidy.de> (raw)
In-Reply-To: <1287062098.3756.9.camel@bigi>

Hi Jamal,

thanks for your help.

> > So it seems like the fl->mark is never initialized with the packet mark
> > in the first place. What would be the correct stage in the kernel
> > network stack to do that?
> 
> Can you try a simple setup without xfrm/ipsec and see if this reverse
> path works? Was there a kernel where it worked?

I just tried opening a simple tcp connection without any xfrm or other weird 
stuff. I just had one iptables rule in place:

-t raw -A OUTPUT -d 192.168.5.200 -j MARK --set-mark 99

192.168.5.200 is the other system I open the tcp connection from. So this 
should mark all response packets to the client.

But the moment __xfrm_lookup is called (this is where my debug printk sits), 
fl->mark is always 0.

By chance I changed the rule over to the mangle table:

-t mangle -A OUTPUT -d 192.168.5.200 -j MARK --set-mark 99

Now it works, the mark in the flow is 99!

So it seems this has nothing to do with xfrm, but that the MARK target has 
different effects when used in raw than in mangle. I was using raw because I 
had to set conntrack zones too and it was more conveniant to do both in one 
place.

Can one of the netfilter guys comment on this? Is using MARK in raw not fully 
supported or has known deficiencies?

Kind regards,

Gerd

-- 
Address (better: trap) for people I really don't want to get mail from:
jonas@cactusamerica.com

  reply	other threads:[~2010-10-14 14:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 13:57 xfrm by MARK: tcp problems when mark for in and out differ Gerd v. Egidy
2010-10-14 12:02 ` jamal
2010-10-14 13:01   ` Gerd v. Egidy
2010-10-14 13:14     ` jamal
2010-10-14 14:14       ` Gerd v. Egidy [this message]
2010-10-14 12:05 ` jamal
2010-10-14 14:16 -j MARK in raw vs. mangle (was Re: xfrm by MARK: tcp problems when mark for in and out differ) Gerd v. Egidy
2010-10-15  7:04 ` Patrick McHardy
2010-10-15  8:05   ` Gerd v. Egidy

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=201010141614.12940.lists@egidy.de \
    --to=lists@egidy.de \
    --cc=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    --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.