Subject: Re: [PATCH net-next 3/6] xfrm: Convert xfrm_dst_lookup() to dscp_t.

From: Guillaume Nault <[email-masked]>
Date: Wed, 16 Oct 2024 10:23:35 +0200

On Tue, Oct 15, 2024 at 04:48:57AM -0700, Eyal Birger wrote:
> On Tue, Oct 15, 2024 at 2:14 AM Guillaume Nault <[email-masked]> wrote:
> >
> > Pass a dscp_t variable to xfrm_dst_lookup(), instead of an int, to
> > prevent accidental setting of ECN bits in ->flowi4_tos.
> >
> > Only xfrm_bundle_create() actually calls xfrm_dst_lookup(). Since it
> > already has a dscp_t variable to pass as parameter, we only need to
> > remove the inet_dscp_to_dsfield() conversion.
> >
> > Signed-off-by: Guillaume Nault <[email-masked]>
> > ---
> >  net/xfrm/xfrm_policy.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
> > index c6ea3ca69e95..6e30b110accf 100644
> > --- a/net/xfrm/xfrm_policy.c
> > +++ b/net/xfrm/xfrm_policy.c
> > @@ -291,7 +291,7 @@ struct dst_entry *__xfrm_dst_lookup(struct net *net, int tos, int oif,
> >  EXPORT_SYMBOL(__xfrm_dst_lookup);
> >
> >  static inline struct dst_entry *xfrm_dst_lookup(struct xfrm_state *x,
> > -                                               int tos, int oif,
> > +                                               dscp_t dscp, int oif,
> 
> 
> FWIW this looks like it's going to conflict with a commit currently in
> the ipsec tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec.git/commit/?id=e509996b16728e37d5a909a5c63c1bd64f23b306

Indeed. I'll send v2 once the ipsec tree will be merged.
Thanks!

> Eyal.