diff options
author | Denys Fedoryshchenko <denys.f@collabora.com> | 2024-09-02 10:33:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-02 10:33:44 +0300 |
commit | 0c021f60244a7fd992916a882fb4ed7277f5cba8 (patch) | |
tree | 76e04750ae3252815431433cc13f90d16bc72058 | |
parent | 187aff3eb45e84b4c5b6a84dfad06e73a45a821f (diff) | |
parent | 2bea84120264ac1b787a7f9fbe970d8ff4d7c028 (diff) | |
download | accel-ppp-0c021f60244a7fd992916a882fb4ed7277f5cba8.tar.gz accel-ppp-0c021f60244a7fd992916a882fb4ed7277f5cba8.zip |
Merge pull request #181 from svlobanov/iputils-be-vlan-add-fix
iputils: fix vlan creation on big-endian platforms
-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; |