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
+1 -4
View File
@@ -4,7 +4,6 @@
#include "sd-event.h"
#include "networkd-link.h"
#include "networkd-setlink.h"
typedef struct Address Address;
typedef struct AddressLabel AddressLabel;
@@ -40,8 +39,6 @@ typedef enum RequestType {
_REQUEST_TYPE_INVALID = -EINVAL,
} RequestType;
assert_cc(sizeof(SetLinkOperation) <= sizeof(void*));
typedef struct Request {
Link *link;
RequestType type;
@@ -56,7 +53,7 @@ typedef struct Request {
NextHop *nexthop;
Route *route;
RoutingPolicyRule *rule;
SetLinkOperation set_link_operation;
void *set_link_operation_ptr;
NetDev *netdev;
void *object;
};