Skip to content

Commit 4e634bf

Browse files
David Ahernpundiramit
authored andcommitted
UPSTREAM: xfrm: Only add l3mdev oif to dst lookups
Subash reported that commit 42a7b32 ("xfrm: Add oif to dst lookups") broke a wifi use case that uses fib rules and xfrms. The intent of 42a7b32 was driven by VRFs with IPsec. As a compromise relax the use of oif in xfrm lookups to L3 master devices only (ie., oif is either an L3 master device or is enslaved to a master device). [cherry-pick of upstream 11d7a0bb95eaaba1741bb24a7c3c169c82f09c7b] Bug: 63589535 Change-Id: Ibadb15341f6c6c7077eccfaa2c66b3bb86b251bf Fixes: 42a7b32 ("xfrm: Add oif to dst lookups") Reported-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent 0bae34f commit 4e634bf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

net/ipv4/xfrm4_policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static struct dst_entry *__xfrm4_dst_lookup(struct net *net, struct flowi4 *fl4,
2929
memset(fl4, 0, sizeof(*fl4));
3030
fl4->daddr = daddr->a4;
3131
fl4->flowi4_tos = tos;
32-
fl4->flowi4_oif = oif;
32+
fl4->flowi4_oif = l3mdev_master_ifindex_by_index(net, oif);
3333
if (saddr)
3434
fl4->saddr = saddr->a4;
3535

net/ipv6/xfrm6_policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static struct dst_entry *xfrm6_dst_lookup(struct net *net, int tos, int oif,
3636
int err;
3737

3838
memset(&fl6, 0, sizeof(fl6));
39-
fl6.flowi6_oif = oif;
39+
fl6.flowi6_oif = l3mdev_master_ifindex_by_index(net, oif);
4040
fl6.flowi6_flags = FLOWI_FLAG_SKIP_NH_OIF;
4141
memcpy(&fl6.daddr, daddr, sizeof(fl6.daddr));
4242
if (saddr)

0 commit comments

Comments
 (0)