From: Paul Chaignon <paul@isovalent.com>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
Martin KaFai Lau <martin.lau@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
Kaixi Fan <fankaixi.li@bytedance.com>,
Nikolay Aleksandrov <razor@blackwall.org>,
Yonghong Song <yhs@fb.com>
Subject: [PATCH bpf v2 0/5] bpf: Allow any source IP in bpf_skb_set_tunnel_key
Date: Mon, 18 Jul 2022 17:53:48 +0200 [thread overview]
Message-ID: <cover.1658159533.git.paul@isovalent.com> (raw)
Commit 26101f5ab6bd ("bpf: Add source ip in "struct bpf_tunnel_key"")
added support for getting and setting the outer source IP of encapsulated
packets via the bpf_skb_{get,set}_tunnel_key BPF helper. This change
allows BPF programs to set any IP address as the source, including for
example the IP address of a container running on the same host.
In that last case, however, the encapsulated packets are dropped when
looking up the route because the source IP address isn't assigned to any
interface on the host. To avoid this, we need to set the
FLOWI_FLAG_ANYSRC flag.
Changes in v2:
- Removed changes to IPv6 code paths as they are unnecessary.
Paul Chaignon (5):
ip_tunnels: Add new flow flags field to ip_tunnel_key
vxlan: Use ip_tunnel_key flow flags in route lookups
geneve: Use ip_tunnel_key flow flags in route lookups
bpf: Set flow flag to allow any source IP in bpf_tunnel_key
selftests/bpf: Don't assign outer source IP to host
drivers/net/geneve.c | 1 +
drivers/net/vxlan/vxlan_core.c | 11 +++++++----
include/net/ip_tunnels.h | 1 +
net/core/filter.c | 1 +
tools/testing/selftests/bpf/prog_tests/test_tunnel.c | 1 -
5 files changed, 10 insertions(+), 5 deletions(-)
--
2.25.1
next reply other threads:[~2022-07-18 15:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 15:53 Paul Chaignon [this message]
2022-07-18 15:54 ` [PATCH bpf v2 1/5] ip_tunnels: Add new flow flags field to ip_tunnel_key Paul Chaignon
2022-07-18 15:54 ` [PATCH bpf v2 2/5] vxlan: Use ip_tunnel_key flow flags in route lookups Paul Chaignon
2022-07-18 15:54 ` [PATCH bpf v2 3/5] geneve: " Paul Chaignon
2022-07-18 15:55 ` [PATCH bpf v2 4/5] bpf: Set flow flag to allow any source IP in bpf_tunnel_key Paul Chaignon
2022-07-18 15:55 ` [PATCH bpf v2 5/5] selftests/bpf: Don't assign outer source IP to host Paul Chaignon
2022-07-18 19:54 ` [PATCH bpf v2 0/5] bpf: Allow any source IP in bpf_skb_set_tunnel_key Martin KaFai Lau
2022-07-19 6:58 ` Nikolay Aleksandrov
2022-07-19 17:44 ` Alexei Starovoitov
2022-07-19 20:40 ` Paul Chaignon
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=cover.1658159533.git.paul@isovalent.com \
--to=paul@isovalent.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=fankaixi.li@bytedance.com \
--cc=john.fastabend@gmail.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=yhs@fb.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).