From: David Ahern <dsa@cumulusnetworks.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: l3mdev: Add master device lookup by index
Date: Sun, 22 Nov 2015 10:30:32 -0700 [thread overview]
Message-ID: <5651FBB8.6030008@cumulusnetworks.com> (raw)
In-Reply-To: <20151122.122359.2247708943529789130.davem@davemloft.net>
On 11/22/15 10:23 AM, David Miller wrote:
> From: David Ahern <dsa@cumulusnetworks.com>
> Date: Thu, 19 Nov 2015 12:32:00 -0800
>
>> Add helper to lookup master index given a device index.
>>
>> Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
>
> I don't like where this is going.
>
> sk->sk_bound_dev_if is for device bindings which the user has
> explicitly asked for.
>
> We should never, therefore, automatically set it without the user's
> consent.
In this case the user is running a daemon (bgpd) where a single instance
works across all VRFs. The listen socket is not bound to a device, so
this does not override what the user ask for. Child sockets are then
bound to the VRF device the connection originates over, so it narrows
the scope of accepted connections to a single VRF.
If you look at the change, e.g.,:
ireq->ir_iif = sk->sk_bound_dev_if ? :
l3mdev_master_ifindex_by_index(sock_net(sk), skb->skb_iif);
It keeps user requested sk_bound_dev_if if it is set. If not, applies
the limited scope of a VRF device if the skb originated on a device
enslaved to a VRF device.
next prev parent reply other threads:[~2015-11-22 17:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 20:32 [PATCH net-next 1/2] net: l3mdev: Add master device lookup by index David Ahern
2015-11-19 20:32 ` [PATCH net-next 2/2] net: Add support for vrf-global TCP servers David Ahern
2015-11-22 17:23 ` [PATCH net-next 1/2] net: l3mdev: Add master device lookup by index David Miller
2015-11-22 17:30 ` David Ahern [this message]
2015-11-22 18:17 ` David Miller
2015-11-23 4:02 ` David Ahern
2015-11-23 4:35 ` David Miller
2015-11-23 18:28 ` David Ahern
-- strict thread matches above, loose matches on Subject: below --
2015-12-15 17:18 [PATCH net-next v2 0/2] net: Allow accepted sockets to be bound to l3mdev domain David Ahern
2015-12-15 17:18 ` [PATCH net-next 1/2] net: l3mdev: Add master device lookup by index David Ahern
2015-12-16 21:20 [PATCH net-next v3 0/2] net: Allow accepted sockets to be bound to l3mdev domain David Ahern
2015-12-16 21:20 ` [PATCH net-next 1/2] net: l3mdev: Add master device lookup by index David Ahern
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=5651FBB8.6030008@cumulusnetworks.com \
--to=dsa@cumulusnetworks.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.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).