summaryrefslogtreecommitdiff
path: root/accel-pppd/libnetlink/iputils.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/libnetlink/iputils.c')
-rw-r--r--accel-pppd/libnetlink/iputils.c3
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;