ipv4: Set scope explicitly in ip_route_output().
authorGuillaume Nault <gnault@redhat.com>
Fri, 5 Apr 2024 20:05:00 +0000 (22:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Apr 2024 12:20:51 +0000 (13:20 +0100)
commitec20b283009346adc66d5a460b1f8fb5adafbcfe
tree36b9dfa207e7d4d663dd41d84f8aae36da254627
parent229783970838887e72083820efb9270b7f276a11
ipv4: Set scope explicitly in ip_route_output().

Add a "scope" parameter to ip_route_output() so that callers don't have
to override the tos parameter with the RTO_ONLINK flag if they want a
local scope.

This will allow converting flowi4_tos to dscp_t in the future, thus
allowing static analysers to flag invalid interactions between
"tos" (the DSCP bits) and ECN.

Only three users ask for local scope (bonding, arp and atm). The others
continue to use RT_SCOPE_UNIVERSE. While there, add a comment to warn
users about the limitations of ip_route_output().

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Acked-by: Leon Romanovsky <leonro@nvidia.com> # infiniband
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/hw/irdma/cm.c
drivers/infiniband/hw/qedr/qedr_iw_cm.c
drivers/net/bonding/bond_main.c
drivers/net/ethernet/broadcom/cnic.c
include/net/route.h
net/atm/clip.c
net/bridge/br_netfilter_hooks.c
net/ipv4/arp.c
net/ipv4/igmp.c
net/mpls/af_mpls.c