aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4/fib_rules.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2024-12-16 19:11:54 +0200
committerPaolo Abeni <pabeni@redhat.com>2024-12-19 16:02:21 +0100
commitf0c898d8c279e6cfdf5e25dc04424d518dec1aa4 (patch)
tree6b7a85047b65e2490a43106f1da78c46936ded03 /net/ipv4/fib_rules.c
parentnet: fib_rules: Add flow label selector attributes (diff)
downloadwireguard-linux-f0c898d8c279e6cfdf5e25dc04424d518dec1aa4.tar.xz
wireguard-linux-f0c898d8c279e6cfdf5e25dc04424d518dec1aa4.zip
ipv4: fib_rules: Reject flow label attributes
IPv4 FIB rules cannot match on flow label so reject requests that try to add such rules. Do that in the IPv4 configure callback as the netlink policy resides in the core and used by both IPv4 and IPv6. Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to '')
-rw-r--r--net/ipv4/fib_rules.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index 8325224ef072..9517b8667e00 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -249,6 +249,12 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
int err = -EINVAL;
struct fib4_rule *rule4 = (struct fib4_rule *) rule;
+ if (tb[FRA_FLOWLABEL] || tb[FRA_FLOWLABEL_MASK]) {
+ NL_SET_ERR_MSG(extack,
+ "Flow label cannot be specified for IPv4 FIB rules");
+ goto errout;
+ }
+
if (!inet_validate_dscp(frh->tos)) {
NL_SET_ERR_MSG(extack,
"Invalid dsfield (tos): ECN bits must be 0");