X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/d5c621ba52626b1cc9778850bf7997cc227d230d..c672f002763b3a4fc30ca229e57f50d3b2e6d766:/print-cnfp.c diff --git a/print-cnfp.c b/print-cnfp.c index e10e2478..5f9d1a3c 100644 --- a/print-cnfp.c +++ b/print-cnfp.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.7 2001-02-21 09:05:39 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.8 2001-09-17 21:57:58 fenner Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -92,10 +92,10 @@ cnfp_print(const u_char *cp, u_int len, const u_char *bp) int nrecs, ver; time_t t; - ip = (struct ip *)bp; - nh = (struct nfhdr *)cp; + ip = (const struct ip *)bp; + nh = (const struct nfhdr *)cp; - if ((u_char *)(nh + 1) > snapend) + if ((const u_char *)(nh + 1) > snapend) return; nrecs = ntohl(nh->ver_cnt) & 0xffff; @@ -110,16 +110,16 @@ cnfp_print(const u_char *cp, u_int len, const u_char *bp) if (ver == 5 || ver == 6) { printf("#%u, ", (unsigned)htonl(nh->sequence)); - nr = (struct nfrec *)&nh[1]; + nr = (const struct nfrec *)&nh[1]; snaplen -= 24; } else { - nr = (struct nfrec *)&nh->sequence; + nr = (const struct nfrec *)&nh->sequence; snaplen -= 16; } printf("%2u recs", nrecs); - for (; nrecs-- && (u_char *)(nr + 1) <= snapend; nr++) { + for (; nrecs-- && (const u_char *)(nr + 1) <= snapend; nr++) { char buf[20]; char asbuf[20];