Skip to content

Commit 5679db6

Browse files
committed
Use more the ND_TCHECK_n() macros
1 parent d5598a4 commit 5679db6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

print-erspan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ erspan_iii_print(netdissect_options *ndo, const u_char *bp, u_int len)
244244

245245
/* Skip timestamp */
246246
ND_ICHECK_U(len, <, 4);
247-
ND_TCHECK_LEN(bp, 4);
247+
ND_TCHECK_4(bp);
248248
bp += 4;
249249
len -= 4;
250250

251251
/* Skip SGT */
252252
ND_ICHECK_U(len, <, 2);
253-
ND_TCHECK_LEN(bp, 2);
253+
ND_TCHECK_2(bp);
254254
bp += 2;
255255
len -= 2;
256256

@@ -269,7 +269,7 @@ erspan_iii_print(netdissect_options *ndo, const u_char *bp, u_int len)
269269
if (hdr2 & ERSPAN3_O_MASK) {
270270
/* Yes. Skip it. */
271271
ND_ICHECK_U(len, <, 8);
272-
ND_TCHECK_LEN(bp, 8);
272+
ND_TCHECK_8(bp);
273273
bp += 8;
274274
len -= 8;
275275
}

print-ether.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
479479
* Fail if we don't have enough data for the Hilscher pseudo-header.
480480
*/
481481
ndo->ndo_protocol = "netanalyzer";
482-
ND_TCHECK_LEN(p, 4);
482+
ND_TCHECK_4(p);
483483

484484
/* Skip the pseudo-header. */
485485
ndo->ndo_ll_hdr_len += 4;

print-gre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ gre_print_1(netdissect_options *ndo, const u_char *bp, u_int length)
371371
if (flags & GRE_KP) {
372372
/* Skip payload length? */
373373
ND_ICHECK_U(len, <, 2);
374-
ND_TCHECK_LEN(bp, 2);
374+
ND_TCHECK_2(bp);
375375
len -= 2;
376376
bp += 2;
377377

print-msdp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
7070
/* RP Address */
7171
ND_ICHECK_U(len, <, 8);
7272
/* XXX -print this based on ndo_vflag? */
73-
ND_TCHECK_LEN(sp + 4, 4);
73+
ND_TCHECK_4(sp + 4);
7474

7575
/* Entries */
7676
ND_TCHECK_LEN(sp + 8, entry_count*12);

0 commit comments

Comments
 (0)