bridge: fix hotplug vlan overwrite on big-endian systems
authorFelix Fietkau <nbd@nbd.name>
Tue, 13 Jul 2021 05:53:40 +0000 (07:53 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 13 Jul 2021 05:53:44 +0000 (07:53 +0200)
The avl key type for bridge vlans is uint16_t, so any lookup with a wider
type is going to fail on big-endian systems
This resulted in hotplug-added devices replacing configured member ports

Signed-off-by: Felix Fietkau <nbd@nbd.name>
bridge.c

index 4f3fe35eef7fcb69dc446cfbcd3d47724f331ad5..6c8e79a47399ca88bdb7fa17f6a0fd0d7c008c9a 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -690,7 +690,7 @@ bridge_add_member(struct bridge_state *bst, const char *name)
 }
 
 static struct bridge_vlan *
-bridge_hotplug_get_vlan(struct bridge_state *bst, unsigned int vid)
+bridge_hotplug_get_vlan(struct bridge_state *bst, uint16_t vid)
 {
        struct bridge_vlan *vlan;