diff options
author | Sergey V. Lobanov <sergey@lobanov.in> | 2024-08-26 20:52:05 +0000 |
---|---|---|
committer | Sergey V. Lobanov <sergey@lobanov.in> | 2024-08-26 20:58:31 +0000 |
commit | 2bea84120264ac1b787a7f9fbe970d8ff4d7c028 (patch) | |
tree | 5cfe2185c37facf618a42bf7e4f657dfe673a4e6 /accel-pppd | |
parent | 2d38a77c008524e293e0dc4b1e46c9093e7a9457 (diff) | |
download | accel-ppp-2bea84120264ac1b787a7f9fbe970d8ff4d7c028.tar.gz accel-ppp-2bea84120264ac1b787a7f9fbe970d8ff4d7c028.zip |
iputils: fix vlan creation on big-endian platforms
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/libnetlink/iputils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/accel-pppd/libnetlink/iputils.c b/accel-pppd/libnetlink/iputils.c index 23325fcd..4bf7fd01 100644 --- a/accel-pppd/libnetlink/iputils.c +++ b/accel-pppd/libnetlink/iputils.c @@ -213,7 +213,8 @@ int __export iplink_vlan_add(const char *ifname, int ifindex, int vid) data = NLMSG_TAIL(&req.n); addattr_l(&req.n, 4096, IFLA_INFO_DATA, NULL, 0); - addattr_l(&req.n, 4096, IFLA_VLAN_ID, &vid, 2); + uint16_t vid_16b = (uint16_t)vid; + addattr_l(&req.n, 4096, IFLA_VLAN_ID, &vid_16b, 2); data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data; linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo; |