]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfrm: Convert xfrm_get_tos() to dscp_t.
authorGuillaume Nault <gnault@redhat.com>
Thu, 31 Oct 2024 15:52:36 +0000 (16:52 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 6 Nov 2024 11:42:16 +0000 (12:42 +0100)
Return a dscp_t variable to prepare for the future conversion of
xfrm_bundle_create() to dscp_t.

While there, rename the function "xfrm_get_dscp", to align its name
with the new return type.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_policy.c

index 8a1b83191a6cdfaa60b1a328b9920f304f6775cc..51a071a790164a18232d021649bf679f3ac1afdc 100644 (file)
@@ -2587,10 +2587,10 @@ xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl,
 
 }
 
-static int xfrm_get_tos(const struct flowi *fl, int family)
+static dscp_t xfrm_get_dscp(const struct flowi *fl, int family)
 {
        if (family == AF_INET)
-               return fl->u.ip4.flowi4_tos & INET_DSCP_MASK;
+               return inet_dsfield_to_dscp(fl->u.ip4.flowi4_tos);
 
        return 0;
 }
@@ -2684,7 +2684,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
 
        xfrm_flowi_addr_get(fl, &saddr, &daddr, family);
 
-       tos = xfrm_get_tos(fl, family);
+       tos = inet_dscp_to_dsfield(xfrm_get_dscp(fl, family));
 
        dst_hold(dst);