From: David Ahern <dsahern@gmail.com>
To: Stephen Suryaputra <ssuryaextr@gmail.com>, netdev@vger.kernel.org
Subject: Re: [PATCH net] vrf: reset rt_iif for recirculated mcast out pkts
Date: Tue, 25 Jun 2019 14:36:59 -0600 [thread overview]
Message-ID: <e5813b87-51c7-d24f-94ec-c18c2bbe6599@gmail.com> (raw)
In-Reply-To: <f0a47b5d-6477-9a6a-cf5d-6e13f0b4acdc@gmail.com>
On 6/25/19 2:22 PM, David Ahern wrote:
> On 6/25/19 4:33 AM, Stephen Suryaputra wrote:
>> @@ -363,10 +376,20 @@ int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb)
>> #endif
>> ) {
>> struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
>> - if (newskb)
>> + if (newskb) {
>> + /* Reset rt_iif so that inet_iif() will return
>> + * skb->dev->ifIndex which is the VRF device for
>> + * socket lookup. Setting this to VRF ifindex
>> + * causes ipi_ifindex in in_pktinfo to be
>> + * overwritten, see ipv4_pktinfo_prepare().
>> + */
>> + if (netif_is_l3_slave(dev))
>
> seems like the rt_iif is a problem for recirculated mcast packets in
> general, not just ones tied to a VRF.
>
>> + ip_mc_reset_rt_iif(net, rt, newskb);
>> +
>> NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING,
>> net, sk, newskb, NULL, newskb->dev,
>> ip_mc_finish_output);
>> + }
>> }
>>
>> /* Multicasts with ttl 0 must not go beyond the host */
Also, wouldn't this problem apply to broadcast packets as well if they
get recirculated back up the stack? Maybe then the reset_rt_iif needs to
be done in ip_mc_finish_output.
next prev parent reply other threads:[~2019-06-25 20:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 10:33 [PATCH net] vrf: reset rt_iif for recirculated mcast out pkts Stephen Suryaputra
2019-06-25 20:22 ` David Ahern
2019-06-25 20:36 ` David Ahern [this message]
2019-06-25 20:42 ` Stephen Suryaputra
2019-06-25 20:52 ` David Ahern
2019-06-25 20:31 ` 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=e5813b87-51c7-d24f-94ec-c18c2bbe6599@gmail.com \
--to=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ssuryaextr@gmail.com \
/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).