Skip to content

Commit 766f532

Browse files
Guillaume Naultklassert
authored andcommitted
xfrm: Convert xfrm_get_tos() to dscp_t.
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>
1 parent 83dfce3 commit 766f532

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

net/xfrm/xfrm_policy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,10 +2587,10 @@ xfrm_tmpl_resolve(struct xfrm_policy **pols, int npols, const struct flowi *fl,
25872587

25882588
}
25892589

2590-
static int xfrm_get_tos(const struct flowi *fl, int family)
2590+
static dscp_t xfrm_get_dscp(const struct flowi *fl, int family)
25912591
{
25922592
if (family == AF_INET)
2593-
return fl->u.ip4.flowi4_tos & INET_DSCP_MASK;
2593+
return inet_dsfield_to_dscp(fl->u.ip4.flowi4_tos);
25942594

25952595
return 0;
25962596
}
@@ -2684,7 +2684,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
26842684

26852685
xfrm_flowi_addr_get(fl, &saddr, &daddr, family);
26862686

2687-
tos = xfrm_get_tos(fl, family);
2687+
tos = inet_dscp_to_dsfield(xfrm_get_dscp(fl, family));
26882688

26892689
dst_hold(dst);
26902690

0 commit comments

Comments
 (0)