diff options
author | Guillaume Nault <gnault@redhat.com> | 2022-02-04 14:58:16 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-02-07 20:12:46 -0800 |
commit | f55fbb6afb8d701e3185e31e73f5ea9503a66744 (patch) | |
tree | 884a144830e7b98ccf4fdf1e138b73aaff01e40a /include/net/ip_fib.h | |
parent | 563f8e97e054451d167327336a53b7381517a998 (diff) | |
download | linux-f55fbb6afb8d701e3185e31e73f5ea9503a66744.tar.gz linux-f55fbb6afb8d701e3185e31e73f5ea9503a66744.tar.bz2 linux-f55fbb6afb8d701e3185e31e73f5ea9503a66744.zip |
ipv4: Reject routes specifying ECN bits in rtm_tos
Use the new dscp_t type to replace the fc_tos field of fib_config, to
ensure IPv4 routes aren't influenced by ECN bits when configured with
non-zero rtm_tos.
Before this patch, IPv4 routes specifying an rtm_tos with some of the
ECN bits set were accepted. However they wouldn't work (never match) as
IPv4 normally clears the ECN bits with IPTOS_RT_MASK before doing a FIB
lookup (although a few buggy code paths don't).
After this patch, IPv4 routes specifying an rtm_tos with any ECN bit
set is rejected.
Note: IPv6 routes ignore rtm_tos altogether, any rtm_tos is accepted,
but treated as if it were 0.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Acked-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r-- | include/net/ip_fib.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index c4297704bbcb..6a82bcb8813b 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h @@ -17,6 +17,7 @@ #include <linux/rcupdate.h> #include <net/fib_notifier.h> #include <net/fib_rules.h> +#include <net/inet_dscp.h> #include <net/inetpeer.h> #include <linux/percpu.h> #include <linux/notifier.h> @@ -24,7 +25,7 @@ struct fib_config { u8 fc_dst_len; - u8 fc_tos; + dscp_t fc_dscp; u8 fc_protocol; u8 fc_scope; u8 fc_type; |