summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/platform/tests/test-route.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/platform/tests/test-route.c b/src/core/platform/tests/test-route.c
index 4b1db7fad7..297230e2e4 100644
--- a/src/core/platform/tests/test-route.c
+++ b/src/core/platform/tests/test-route.c
@@ -1398,12 +1398,17 @@ again_table:
rr->protocol = _rr_rand_choose_u8(nmtst_get_rand_uint32());
#define IPTOS_TOS_MASK 0x1E
+#define INET_DSCP_MASK 0xFC
again_tos:
rr->tos = _rr_rand_choose_u8(nmtst_get_rand_uint32());
+
if (rr->addr_family == AF_INET && rr->tos & ~IPTOS_TOS_MASK)
goto again_tos;
+ if (rr->tos & ~INET_DSCP_MASK)
+ goto again_tos;
+
if (_rule_check_kernel_support(platform, FRA_IP_PROTO))
rr->ip_proto = _rr_rand_choose_u8(nmtst_get_rand_uint32());