Skip to content

Commit da4cfa2

Browse files
wkzcappe987
authored andcommitted
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). Add DSA test PCAPs with packets containing a high VID and non-zero FPri values to make sure we catch any future regressions. Signed-off-by: Tobias Waldekranz <[email protected]>
1 parent 2a83aab commit da4cfa2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

print-dsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
#define DSA_RX_SNIFF(tag) TOK(tag, 1, 0x04, 2)
8484
#define DSA_CFI(tag) TOK(tag, 1, 0x01, 0)
8585
#define DSA_PRI(tag) TOK(tag, 2, 0xe0, 5)
86-
#define DSA_VID(tag) ((u_short)((TOK(tag, 2, 0xe0, 5) << 8) | (TOK(tag, 3, 0xff, 0))))
86+
#define DSA_VID(tag) ((u_short)((TOK(tag, 2, 0x0f, 0) << 8) | (TOK(tag, 3, 0xff, 0))))
8787
#define DSA_CODE(tag) ((TOK(tag, 1, 0x06, 1) << 1) | TOK(tag, 2, 0x10, 4))
8888

8989
#define EDSA_LEN 8

0 commit comments

Comments
 (0)