]> git.ipfire.org Git - thirdparty/linux.git/commit
ipv4: Convert ip_route_input_rcu() to dscp_t.
authorGuillaume Nault <gnault@redhat.com>
Tue, 1 Oct 2024 19:28:55 +0000 (21:28 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Oct 2024 23:21:21 +0000 (16:21 -0700)
commitbe612f5e99e1d48de34f4befcb700d840c15e05e
treed4a3ef8e28d17d30bc60a6b4dfd43a0e717622e8
parent66fb6386d358a04edd5c640e38b4a02b323b89d8
ipv4: Convert ip_route_input_rcu() to dscp_t.

Pass a dscp_t variable to ip_route_input_rcu(), instead of a plain u8,
to prevent accidental setting of ECN bits in ->flowi4_tos.

Callers of ip_route_input_rcu() to consider are:

  * ip_route_input_noref(), which already has a dscp_t variable to pass
    as parameter. We just need to remove the inet_dscp_to_dsfield()
    conversion.

  * inet_rtm_getroute(), which receives a u8 from user space and needs
    to convert it with inet_dsfield_to_dscp().

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/c4dbb5aa9cbc79c4fcb317abbffa7c7156bc56a7.1727807926.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/route.c