Skip to content

Commit 4b041d2

Browse files
idoschkuba-moo
authored andcommitted
net: fib_rules: Enable DSCP selector usage
Now that both IPv4 and IPv6 support the new DSCP selector, enable user space to configure FIB rules that make use of it by changing the policy of the new DSCP attribute so that it accepts values in the range of [0, 63]. Use NLA_U8 rather than NLA_UINT as the field is of fixed size. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Guillaume Nault <gnault@redhat.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20240911093748.3662015-5-idosch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 2cf6300 commit 4b041d2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/core/fib_rules.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/list.h>
1212
#include <linux/module.h>
1313
#include <net/net_namespace.h>
14+
#include <net/inet_dscp.h>
1415
#include <net/sock.h>
1516
#include <net/fib_rules.h>
1617
#include <net/ip_tunnels.h>
@@ -767,7 +768,7 @@ static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = {
767768
[FRA_IP_PROTO] = { .type = NLA_U8 },
768769
[FRA_SPORT_RANGE] = { .len = sizeof(struct fib_rule_port_range) },
769770
[FRA_DPORT_RANGE] = { .len = sizeof(struct fib_rule_port_range) },
770-
[FRA_DSCP] = { .type = NLA_REJECT },
771+
[FRA_DSCP] = NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2),
771772
};
772773

773774
int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,

0 commit comments

Comments
 (0)