network: use void* to correctly store SetLinkOperation in Request

Previously, when `link_request_queue()` is called in link_request_set_link(),
`SetLinkOperation` is casted with INT_TO_PTR(), and the value is assigned to
`void *object`. However the value was read directly through the member
`SetLinkOperation set_link_operation` of the union which `object`
beloging to. Thus, read value was always 0 on big-endian systems.

Fixes configuring link issue on s390x systems.
This commit is contained in:
Yu Watanabe
2021-06-15 20:58:20 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent b428efa54b
commit 9b682672e4
5 changed files with 22 additions and 14 deletions
+2 -1
View File
@@ -26,6 +26,7 @@
#include "netlink-util.h"
#include "networkd-manager.h"
#include "networkd-queue.h"
#include "networkd-setlink.h"
#include "nlmon.h"
#include "path-lookup.h"
#include "siphash24.h"
@@ -550,7 +551,7 @@ static bool netdev_is_ready_to_create(NetDev *netdev, Link *link) {
req = (Request) {
.link = link,
.type = REQUEST_TYPE_SET_LINK,
.set_link_operation = SET_LINK_MTU,
.set_link_operation_ptr = INT_TO_PTR(SET_LINK_MTU),
};
if (ordered_set_contains(link->manager->request_queue, &req))