Skip to content

Commit

Permalink
Merge pull request accel-ppp#181 from svlobanov/iputils-be-vlan-add-fix
Browse files Browse the repository at this point in the history
iputils: fix vlan creation on big-endian platforms
  • Loading branch information
nuclearcat authored Sep 2, 2024
2 parents 187aff3 + 2bea841 commit 0c021f6
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 0c021f6

Please sign in to comment.