sst-linux/net/bridge
Guillaume Nault 3e8520bca5 ipv4: Convert ip_route_input() to dscp_t.
[ Upstream commit 7e863e5db6185b1add0df4cb01b31a4ed1c4b738 ]

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

Callers of ip_route_input() to consider are:

  * input_action_end_dx4_finish() and input_action_end_dt4() in
    net/ipv6/seg6_local.c. These functions set the tos parameter to 0,
    which is already a valid dscp_t value, so they don't need to be
    adjusted for the new prototype.

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

  * br_nf_pre_routing_finish(), ip_options_rcv_srr() and ip4ip6_err(),
    which get the DSCP directly from IPv4 headers. Define a helper to
    read the .tos field of struct iphdr as dscp_t, so that these
    function don't have to do the conversion manually.

While there, declare *iph as const in br_nf_pre_routing_finish(),
declare its local variables in reverse-christmas-tree order and move
the "err = ip_route_input()" assignment out of the conditional to avoid
checkpatch warning.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/e9d40781d64d3d69f4c79ac8a008b8d67a033e8d.1727807926.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 27843ce6ba3d ("ipvlan: ensure network headers are in skb linear part")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-03-07 16:56:44 +01:00
..
netfilter netfilter: br_netfilter: skip conntrack input hook for promisc packets 2024-04-27 17:07:07 +02:00
br_arp_nd_proxy.c
br_cfm_netlink.c
br_cfm.c
br_device.c net: bridge: xmit: make sure we have at least eth header len bytes 2024-06-12 11:03:32 +02:00
br_fdb.c net: bridge: br_fdb_external_learn_add(): always set EXT_LEARN 2024-09-12 11:10:22 +02:00
br_forward.c net: bridge: mst: Check vlan state for egress decision 2024-08-03 08:49:09 +02:00
br_if.c
br_input.c netfilter: br_netfilter: skip conntrack input hook for promisc packets 2024-04-27 17:07:07 +02:00
br_ioctl.c
br_mdb.c
br_mrp_netlink.c
br_mrp_switchdev.c
br_mrp.c
br_mst.c net: bridge: mst: fix suspicious rcu usage in br_mst_set_state 2024-06-21 14:35:52 +02:00
br_multicast_eht.c
br_multicast.c net: bridge: mcast: wait for previous gc cycles when removing port 2024-08-14 13:52:43 +02:00
br_netfilter_hooks.c ipv4: Convert ip_route_input() to dscp_t. 2025-03-07 16:56:44 +01:00
br_netfilter_ipv6.c
br_netlink_tunnel.c
br_netlink.c net-sysfs: convert dev->operstate reads to lockless ones 2024-05-17 11:56:13 +02:00
br_nf_core.c
br_private_cfm.h
br_private_mcast_eht.h
br_private_mrp.h
br_private_stp.h
br_private_tunnel.h
br_private.h netfilter: br_netfilter: skip conntrack input hook for promisc packets 2024-04-27 17:07:07 +02:00
br_stp_bpdu.c
br_stp_if.c
br_stp_timer.c
br_stp.c
br_switchdev.c net: bridge: switchdev: Ensure deferred event delivery on unoffload 2024-03-01 13:26:36 +01:00
br_sysfs_br.c
br_sysfs_if.c
br_vlan_options.c
br_vlan_tunnel.c
br_vlan.c
br.c
Kconfig
Makefile