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.
*/
#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
}
len = *bp++;
if (bp + len >= snapend) {
- fputs(tstr, stdout);
+ printf("[|bootp %u]", len);
return;
}
putchar('"');
(void)fn_printn(bp, size, NULL);
putchar('"');
+ bp += size;
+ size = 0;
break;
} else {
printf("[%s]", tok2str(arp2str, "type-%d", type));
break;
}
/* Data left over? */
- if (size)
+ if (size) {
printf("[len %u]", len);
+ bp += size;
+ }
}
return;
trunc: