Skip to content

Commit

Permalink
iputils: fix vlan creation on big-endian platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
svlobanov committed Aug 26, 2024
1 parent c0df4a3 commit 6431bc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion accel-pppd/libnetlink/iputils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6431bc8

Please sign in to comment.