]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: Fix BRIDGE_VLAN_TUNNEL attribute sizes
authorBenjamin Poirier <bpoirier@cumulusnetworks.com>
Mon, 16 Dec 2019 06:43:41 +0000 (15:43 +0900)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 17 Dec 2019 04:49:28 +0000 (20:49 -0800)
As per the kernel's vlan_tunnel_policy, IFLA_BRIDGE_VLAN_TUNNEL_VID and
IFLA_BRIDGE_VLAN_TUNNEL_FLAGS have type NLA_U16.

Fixes: 8652eeb3ab12 ("bridge: vlan: support for per vlan tunnel info")
Signed-off-by: Benjamin Poirier <bpoirier@cumulusnetworks.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/vlan.c

index 6dc694b6565b749d69f87e70d0839bf06eedd914..c0294aa6990cbcaee26603c278a7e4f6befda446 100644 (file)
@@ -71,8 +71,8 @@ static int add_tunnel_info(struct nlmsghdr *n, int reqsize,
 
        tinfo = addattr_nest(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_INFO);
        addattr32(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_ID, tun_id);
-       addattr32(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_VID, vid);
-       addattr32(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, flags);
+       addattr16(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_VID, vid);
+       addattr16(n, reqsize, IFLA_BRIDGE_VLAN_TUNNEL_FLAGS, flags);
 
        addattr_nest_end(n, tinfo);
 
@@ -304,7 +304,7 @@ static void print_vlan_tunnel_info(FILE *fp, struct rtattr *tb, int ifindex)
 
                if (ttb[IFLA_BRIDGE_VLAN_TUNNEL_VID])
                        tunnel_vid =
-                               rta_getattr_u32(ttb[IFLA_BRIDGE_VLAN_TUNNEL_VID]);
+                               rta_getattr_u16(ttb[IFLA_BRIDGE_VLAN_TUNNEL_VID]);
                else
                        continue;
 
@@ -314,7 +314,7 @@ static void print_vlan_tunnel_info(FILE *fp, struct rtattr *tb, int ifindex)
 
                if (ttb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS])
                        tunnel_flags =
-                               rta_getattr_u32(ttb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS]);
+                               rta_getattr_u16(ttb[IFLA_BRIDGE_VLAN_TUNNEL_FLAGS]);
 
                if (!(tunnel_flags & BRIDGE_VLAN_INFO_RANGE_END)) {
                        last_vid_start = tunnel_vid;