From: David Miller <davem@davemloft.net>
To: socketcan@hartkopp.net
Cc: netdev@vger.kernel.org
Subject: Re: [RFC davem] revert: net: Make skb->skb_iif always track skb->dev
Date: Sat, 12 Jan 2013 13:36:30 -0800 (PST) [thread overview]
Message-ID: <20130112.133630.257139657732337147.davem@davemloft.net> (raw)
In-Reply-To: <20130112.132316.2121287993605534669.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Sat, 12 Jan 2013 13:23:16 -0800 (PST)
> From: Oliver Hartkopp <socketcan@hartkopp.net>
> Date: Sat, 12 Jan 2013 14:48:14 +0100
>
>> To me it is not clear why skb_iff is needed anyway as the value should
>> always be available via skb->dev->ifindex, right?
>
> But all the code uses skb_iif, in particular the ipv4 routing
> lookups use that as the key.
>
> It absolutely must follow whatever is skb->dev, it is a hard
> invariant.
>
> I am not reverting this change.
More information, because I can't believe how idiotic and
ignorant people are being able this issue.
skb->dev->ifindex IS NOT the same as skb->skb_iif
Why don't you put a test into tcp_recvmsg() for packets being removed
from the socket's receive queue and see if skb->dev->ifindex is the
same as skb->skb_iif
Surprise, skb->dev is going to be NULL at that point.
Why?
Because on packet receive we don't take references on devices we hook
into skb->dev, therefore we cannot let that pointer escape the
software interrupt packet input paths.
Therefore, as a bug trap, TCP input will set skb->dev to NULL.
The only valid way to figure out the final demuxed device the packet
arrived on, is therefore, via skb->skb_iif.
As per your problem with CAN, that's also rediculous. You have an SKB
control block in skb->cb[] that you can put whatever values with
whatever semantics you want.
Use it.
I'm not discussing this any further.
next prev parent reply other threads:[~2013-01-12 21:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-12 13:48 [RFC davem] revert: net: Make skb->skb_iif always track skb->dev Oliver Hartkopp
2013-01-12 18:13 ` Jiri Pirko
2013-01-12 18:40 ` Oliver Hartkopp
2013-01-12 19:37 ` Jiri Pirko
2013-01-12 20:14 ` Oliver Hartkopp
2013-01-12 21:23 ` David Miller
2013-01-12 21:36 ` David Miller [this message]
2013-01-13 3:06 ` [PATCH net-next] pkt_sched: namespace aware ifb Eric Dumazet
2013-01-13 3:50 ` Benjamin LaHaise
2013-01-13 5:49 ` Eric Dumazet
2013-01-13 14:44 ` Jamal Hadi Salim
2013-01-13 16:41 ` Benjamin LaHaise
2013-01-13 16:57 ` Eric Dumazet
2013-01-13 17:25 ` Jamal Hadi Salim
2013-01-14 5:40 ` Eric Dumazet
2013-01-13 17:46 ` [PATCH net-next] ifb: dont hard code inet_net use Eric Dumazet
2013-01-14 13:13 ` Jamal Hadi Salim
2013-01-14 15:15 ` [PATCH net-next] pkt_sched: namespace aware act_mirred Benjamin LaHaise
2013-01-14 20:10 ` David Miller
2013-01-14 20:13 ` [PATCH net-next] ifb: dont hard code inet_net use David Miller
2013-01-13 14:59 ` [PATCH net-next] pkt_sched: namespace aware ifb Benjamin LaHaise
2013-01-13 16:35 ` Eric Dumazet
2013-01-13 11:01 ` [RFC davem] revert: net: Make skb->skb_iif always track skb->dev Oliver Hartkopp
2013-01-13 13:20 ` David Miller
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=20130112.133630.257139657732337147.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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).