From: Patrick McHardy <kaber@trash.net>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
den@openvz.org, xemul@openvz.org, ebiederm@xmission.com,
benjamin.thery@bull.net, dlezcano@fr.ibm.com
Subject: Re: [PATCH 09/25] netns ct: get proper netns from netdevice
Date: Mon, 23 Jun 2008 12:35:00 +0200 [thread overview]
Message-ID: <485F7C54.5070506@trash.net> (raw)
In-Reply-To: <20080622010821.GJ5392@martell.zuzino.mipt.ru>
Alexey Dobriyan wrote:
> Get netns from skb->dev on input, from skb->dst->dev on output to know
> where to create or search for conntrack.
>
> Is there some documentation re which device accessible from skb is valid
> at which point?
For netfilter hooks, skb->dev points to the input device in
PREROUTING, INPUT, FORWARD, to the output device in POSTROUTING
and is invalid in OUTPUT.
> @@ -626,10 +628,14 @@ resolve_normal_ct(struct sk_buff *skb,
> return NULL;
> }
>
> + dev = skb->dev;
> + if (!dev)
> + dev = skb->dst->dev;
> + net = dev_net(dev);
Maybe just pass it though nf_conntrack_in from the hook functions,
those get the devices as arguments.
prev parent reply other threads:[~2008-06-23 10:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-22 1:08 [PATCH 09/25] netns ct: get proper netns from netdevice Alexey Dobriyan
2008-06-23 10:35 ` Patrick McHardy [this message]
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=485F7C54.5070506@trash.net \
--to=kaber@trash.net \
--cc=adobriyan@gmail.com \
--cc=benjamin.thery@bull.net \
--cc=den@openvz.org \
--cc=dlezcano@fr.ibm.com \
--cc=ebiederm@xmission.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=xemul@openvz.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).