Skip to content

Commit d5f000d

Browse files
committed
VXLAN: Replace the remaining "goto invalid" check with ND_ICHECK_U()
Rename variable 'len' to 'length' for ND_ICHECK_U() printing.
1 parent 85c7815 commit d5f000d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

print-vxlan.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ static const struct tok vxlan_flags [] = {
4848
*/
4949

5050
void
51-
vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len)
51+
vxlan_print(netdissect_options *ndo, const u_char *bp, u_int length)
5252
{
5353
uint8_t flags;
5454

5555
ndo->ndo_protocol = "vxlan";
5656
nd_print_protocol_caps(ndo);
57-
if (len < VXLAN_HDR_LEN)
58-
goto invalid;
57+
ND_ICHECK_U(length, <, VXLAN_HDR_LEN);
5958

6059
flags = GET_U_1(bp);
6160
bp += 1;
@@ -78,7 +77,7 @@ vxlan_print(netdissect_options *ndo, const u_char *bp, u_int len)
7877
ND_TCHECK_1(bp);
7978
bp += 1;
8079

81-
ether_print(ndo, bp, len - VXLAN_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
80+
ether_print(ndo, bp, length - VXLAN_HDR_LEN, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL);
8281

8382
return;
8483

0 commit comments

Comments
 (0)