xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
Subsystems (3)
PATCH 1/1 xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup
The commit referenced in the Fixes tag no longer changes the flow oif to the l3mdev ifindex. A xfrm use case was expecting the flowi_oif to be the VRF if relevant and the change broke that test. Update xfrm_bundle_create to pass oif if set and any potential flowi_l3mdev if oif is not set.
--- net/xfrm/xfrm_policy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/xfrm/xfrm_policy.c +3 -1
@@ -2593,12 +2593,14 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,if (xfrm[i]->props.mode !=XFRM_MODE_TRANSPORT ) {__u32 mark =0 ; +int oif;if (xfrm[i]->props.smark.v || xfrm[i]->props.smark.m) mark =xfrm_smark_get (fl->flowi_mark, xfrm[i]); family = xfrm[i]->props.family; - dst =xfrm_dst_lookup (xfrm[i], tos, fl->flowi_oif, + oif = fl->flowi_oif ? : fl->flowi_l3mdev; + dst =xfrm_dst_lookup (xfrm[i], tos, oif, &saddr, &daddr, family, mark); err =PTR_ERR (dst);if (IS_ERR (dst))
Signature · 1 line
2.24.3 (Apple Git-128)
Jakub Kicinski
maintainerQuoted 3 lines · On Thu, 31 Mar 2022 19:53:34 -0600 David Ahern wrote:
To: [email protected], [email protected], [email protected], [email protected]
Cc: [email protected], David Ahern <[email protected]>
Subject: [PATCH net] xfrm: Passflowi_oifor l3mdev as oif toxfrm_dst_lookup
This needs Steffen and Herbert on CC. I'd just CC them in but patch was marked as Awaiting upstream in our PW already, so repost would be better. Regardless which tree it ends up getting applied to.
Quoted 9 lines
The commit referenced in the Fixes tag no longer changes the flow oif to the l3mdev ifindex. A xfrm use case was expecting the
flowi_oifto be the VRF if relevant and the change broke that test. Updatexfrm_bundle_createto pass oif if set and any potentialflowi_l3mdevif oif is not set.Fixes 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")Reported-by kernel test robot <[email protected]>Signed-off-by David Ahern <[email protected]>
Quoted 9 lines · Jakub Kicinski
Quoted 3 lines · On Thu, 31 Mar 2022 19:53:34 -0600 David Ahern wrote:
To: [email protected], [email protected], [email protected], [email protected]
Cc: [email protected], David Ahern <[email protected]>
Subject: [PATCH net] xfrm: Passflowi_oifor l3mdev as oif toxfrm_dst_lookupThis needs Steffen and Herbert on CC. I'd just CC them in but patch was marked as Awaiting upstream in our PW already, so repost would be better. Regardless which tree it ends up getting applied to.
Prior l3mdev stuff went in through net/net-next, hence the cc list for this one. I will re-send adding them.
Quoted 10 lines
Quoted 10 lines
The commit referenced in the Fixes tag no longer changes the flow oif to the l3mdev ifindex. A xfrm use case was expecting the
flowi_oifto be the VRF if relevant and the change broke that test. Updatexfrm_bundle_createto pass oif if set and any potentialflowi_l3mdevif oif is not set.Fixes 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")Reported-by kernel test robot <[email protected]>Signed-off-by David Ahern <[email protected]>