From 0404ff08b3c18052e6689d75fa85275d3cef7e8e Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 14 Dec 2023 15:39:27 +0100 Subject: netlink: don't crash if prefix for < byte is requested If prefix is used with a datatype that has less than 8 bits an assertion is triggered: src/netlink.c:243: netlink_gen_raw_data: Assertion `len > 0' failed. This is esoteric, the alternative would be to restrict prefixes to ipv4/ipv6 addresses. Simpler fix is to use round_up instead of divide. Signed-off-by: Florian Westphal --- tests/py/ip/ip.t | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/py/ip/ip.t') diff --git a/tests/py/ip/ip.t b/tests/py/ip/ip.t index 720d9ae9..e6999c29 100644 --- a/tests/py/ip/ip.t +++ b/tests/py/ip/ip.t @@ -133,3 +133,5 @@ ip saddr . ip daddr vmap { 192.168.5.1-192.168.5.128 . 192.168.6.1-192.168.6.128 ip saddr 1.2.3.4 ip daddr 3.4.5.6;ok ip saddr 1.2.3.4 counter ip daddr 3.4.5.6;ok + +ip dscp 1/6;ok;ip dscp & 0x3f == lephb -- cgit v1.2.3