]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/brvlan: convert condtion to assertion
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 Nov 2023 06:15:18 +0000 (15:15 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 Nov 2023 18:58:46 +0000 (03:58 +0900)
The condition should be always true.

src/network/networkd-bridge-vlan.c

index 969a7da30b4b4310a7b139564f763d72b7461b1a..a3d90651e5bed3b586fdb86cde93915deed7df44 100644 (file)
@@ -23,8 +23,8 @@ static bool is_bit_set(unsigned nr, const uint32_t *addr) {
 }
 
 static void set_bit(unsigned nr, uint32_t *addr) {
-        if (nr < BRIDGE_VLAN_BITMAP_MAX)
-                addr[nr / 32] |= (UINT32_C(1) << (nr % 32));
+        assert(nr < BRIDGE_VLAN_BITMAP_MAX);
+        addr[nr / 32] |= (UINT32_C(1) << (nr % 32));
 }
 
 static int add_single(sd_netlink_message *m, uint16_t id, bool untagged, bool is_pvid) {