diff options
| author | Gordon Tetlow <gordon@FreeBSD.org> | 2017-09-18 04:10:54 +0000 |
|---|---|---|
| committer | Gordon Tetlow <gordon@FreeBSD.org> | 2017-09-18 04:10:54 +0000 |
| commit | 4533b6d8a9b95fc043b72b3656b98e79ac839041 (patch) | |
| tree | 4ac156eafa4323886af859c09363dff43cc44106 /print-wb.c | |
| parent | d79b843cb78484ea27f877f1541055e1a6a5a4d3 (diff) | |
Diffstat (limited to 'print-wb.c')
| -rw-r--r-- | print-wb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/print-wb.c b/print-wb.c index 88857d9618d7..c0df48d74718 100644 --- a/print-wb.c +++ b/print-wb.c @@ -263,9 +263,8 @@ wb_prep(netdissect_options *ndo, const u_char *ep = ndo->ndo_snapend; ND_PRINT((ndo, " wb-prep:")); - if (len < sizeof(*prep)) { + if (len < sizeof(*prep) || !ND_TTEST(*prep)) return (-1); - } n = EXTRACT_32BITS(&prep->pp_n); ps = (const struct pgstate *)(prep + 1); while (--n >= 0 && ND_TTEST(*ps)) { @@ -419,31 +418,37 @@ wb_print(netdissect_options *ndo, case PT_ID: if (wb_id(ndo, (const struct pkt_id *)(ph + 1), len) >= 0) return; + ND_PRINT((ndo, "%s", tstr)); break; case PT_RREQ: if (wb_rreq(ndo, (const struct pkt_rreq *)(ph + 1), len) >= 0) return; + ND_PRINT((ndo, "%s", tstr)); break; case PT_RREP: if (wb_rrep(ndo, (const struct pkt_rrep *)(ph + 1), len) >= 0) return; + ND_PRINT((ndo, "%s", tstr)); break; case PT_DRAWOP: if (wb_drawop(ndo, (const struct pkt_dop *)(ph + 1), len) >= 0) return; + ND_PRINT((ndo, "%s", tstr)); break; case PT_PREQ: if (wb_preq(ndo, (const struct pkt_preq *)(ph + 1), len) >= 0) return; + ND_PRINT((ndo, "%s", tstr)); break; case PT_PREP: if (wb_prep(ndo, (const struct pkt_prep *)(ph + 1), len) >= 0) return; + ND_PRINT((ndo, "%s", tstr)); break; default: |
