diff options
| author | fenner <fenner> | 2003-03-12 19:25:40 +0000 |
|---|---|---|
| committer | fenner <fenner> | 2003-03-12 19:25:40 +0000 |
| commit | d35664b74857a254f469e178a805b36751254610 (patch) | |
| tree | d262320fe88fcc44324200715c8098ba48d60ba9 /print-bootp.c | |
| parent | d85d9ee28c1b0c9e3a26a87367ca5f8d4c1fedac (diff) | |
| download | tcpdump-d35664b74857a254f469e178a805b36751254610.tar.gz | |
Print the length in the truncation message if we know it.
Fix the CID parser for type=0 (ASCII text) client IDs.
Make the overall parser a little more robust to buggy parsers like
the CID one by incrementing bp when there are bytes left over.
Diffstat (limited to 'print-bootp.c')
| -rw-r--r-- | print-bootp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/print-bootp.c b/print-bootp.c index ebf4739d..88e1e847 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -22,7 +22,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.69 2002-12-18 08:53:20 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.70 2003-03-12 19:25:40 fenner Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -376,7 +376,7 @@ rfc1048_print(register const u_char *bp) } len = *bp++; if (bp + len >= snapend) { - fputs(tstr, stdout); + printf("[|bootp %u]", len); return; } @@ -571,6 +571,8 @@ rfc1048_print(register const u_char *bp) putchar('"'); (void)fn_printn(bp, size, NULL); putchar('"'); + bp += size; + size = 0; break; } else { printf("[%s]", tok2str(arp2str, "type-%d", type)); @@ -596,8 +598,10 @@ rfc1048_print(register const u_char *bp) break; } /* Data left over? */ - if (size) + if (size) { printf("[len %u]", len); + bp += size; + } } return; trunc: |
