From 6ca6a793c59fb22d66ad59aac93396351df74115 Mon Sep 17 00:00:00 2001
From: Tobias Waldekranz <tobias@waldekranz.com>
Date: Fri, 30 Oct 2020 11:10:44 +0100
Subject: [PATCH] DSA: Correctly determine VID

The 4 MSBs of the VID is stored in the lower nibble of the tag's third
byte.

Previously the priority bits where folded into the VID space, e.g. a
packet with VID=1 and priority 6 was printed as having a VID of
1537 (0x601).
---
 print-dsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/print-dsa.c b/print-dsa.c
index e45dc53fb..1ed9acf67 100644
--- a/print-dsa.c
+++ b/print-dsa.c
@@ -83,7 +83,7 @@
 #define DSA_RX_SNIFF(tag) TOK(tag, 1, 0x04, 2)
 #define DSA_CFI(tag) TOK(tag, 1, 0x01, 0)
 #define DSA_PRI(tag) TOK(tag, 2, 0xe0, 5)
-#define DSA_VID(tag) ((u_short)((TOK(tag, 2, 0xe0, 5) << 8) | (TOK(tag, 3, 0xff, 0))))
+#define DSA_VID(tag) ((u_short)((TOK(tag, 2, 0x0f, 0) << 8) | (TOK(tag, 3, 0xff, 0))))
 #define DSA_CODE(tag) ((TOK(tag, 1, 0x06, 1) << 1) | TOK(tag, 2, 0x10, 4))
 
 #define EDSA_LEN 8
