Skip to content

Commit a29d45c

Browse files
committed
network: fix endian issue in converting port to network id
Use little endian to remain compatible with most systems Signed-off-by: Felix Fietkau <[email protected]>
1 parent 203c888 commit a29d45c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

network.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static void network_load_config_data(struct network *net, struct blob_attr *data
9393
const char *id = blobmsg_get_string(cur);
9494
siphash_to_le64(&net->net_config.addr.network_id, id, strlen(id), &key);
9595
} else {
96-
siphash_to_le64(&net->net_config.addr.network_id, &net->net_config.port,
97-
sizeof(net->net_config.port), &key);
96+
uint32_t port = cpu_to_le32(net->net_config.port);
97+
siphash_to_le64(&net->net_config.addr.network_id, &port, sizeof(port), &key);
9898
}
9999

100100
net->net_config.addr.network_id[0] = 0xfd;

0 commit comments

Comments
 (0)