All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Poirier <bpoirier@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: Roopa Prabhu <roopa@cumulusnetworks.com>
Subject: [PATCH iproute2 5/8] bridge: Fix BRIDGE_VLAN_TUNNEL attribute sizes
Date: Mon, 16 Dec 2019 15:43:41 +0900	[thread overview]
Message-ID: <20191216064344.1470824-6-bpoirier@cumulusnetworks.com> (raw)
In-Reply-To: <20191216064344.1470824-1-bpoirier@cumulusnetworks.com>

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>
---
 bridge/vlan.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bridge/vlan.c b/bridge/vlan.c
index 6dc694b6..c0294aa6 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -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;
-- 
2.24.0


  parent reply	other threads:[~2019-12-16  6:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16  6:43 [PATCH iproute2 0/8] bridge vlan tunnelshow fixes Benjamin Poirier
2019-12-16  6:43 ` [PATCH iproute2 1/8] json_print: Remove declaration without implementation Benjamin Poirier
2019-12-16  6:43 ` [PATCH iproute2 2/8] testsuite: Fix line count test Benjamin Poirier
2019-12-16  6:43 ` [PATCH iproute2 3/8] bridge: Fix typo in error messages Benjamin Poirier
2019-12-16  6:43 ` [PATCH iproute2 4/8] bridge: Fix src_vni argument in man page Benjamin Poirier
2019-12-16  6:43 ` Benjamin Poirier [this message]
2019-12-16  6:43 ` [PATCH iproute2 6/8] bridge: Fix vni printing Benjamin Poirier
2019-12-16  6:43 ` [PATCH iproute2 7/8] bridge: Deduplicate vlan show functions Benjamin Poirier
2019-12-16  6:43 ` [PATCH iproute2 8/8] bridge: Fix tunnelshow json output Benjamin Poirier
2019-12-17  4:51 ` [PATCH iproute2 0/8] bridge vlan tunnelshow fixes Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191216064344.1470824-6-bpoirier@cumulusnetworks.com \
    --to=bpoirier@cumulusnetworks.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.