Don't use len without initializing in ip_printts()
(in the case of an invalid type).
#ifndef lint
static const char rcsid[] =
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.77 1999-11-23 08:31:10 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.78 1999-12-15 00:34:10 fenner Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
#ifdef HAVE_CONFIG_H
u_int tr_rttlqid; /* response ttl and qid */
};
u_int tr_rttlqid; /* response ttl and qid */
};
-#define TR_GETTTL(x) (((x) >> 24) & 0xff)
+#define TR_GETTTL(x) (int)(((x) >> 24) & 0xff)
#define TR_GETQID(x) ((x) & 0x00ffffff)
/*
#define TR_GETQID(x) ((x) & 0x00ffffff)
/*
{
register struct tr_query *tr = (struct tr_query *)(bp + 8);
{
register struct tr_query *tr = (struct tr_query *)(bp + 8);
- printf("mtrace %d: %s to %s reply-to %s",
+ printf("mtrace %ld: %s to %s reply-to %s",
TR_GETQID(ntohl(tr->tr_rttlqid)),
ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst),
ipaddr_string(&tr->tr_raddr));
TR_GETQID(ntohl(tr->tr_rttlqid)),
ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst),
ipaddr_string(&tr->tr_raddr));
{
register struct tr_query *tr = (struct tr_query *)(bp + 8);
{
register struct tr_query *tr = (struct tr_query *)(bp + 8);
- printf("mresp %d: %s to %s reply-to %s",
+ printf("mresp %ld: %s to %s reply-to %s",
TR_GETQID(ntohl(tr->tr_rttlqid)),
ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst),
ipaddr_string(&tr->tr_raddr));
TR_GETQID(ntohl(tr->tr_rttlqid)),
ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst),
ipaddr_string(&tr->tr_raddr));
ip_printts(register const u_char *cp, u_int length)
{
register u_int ptr = cp[2] - 1;
ip_printts(register const u_char *cp, u_int length)
{
register u_int ptr = cp[2] - 1;
+ register u_int len = 0;
for (len = 4; len < length; len += hoplen) {
if (ptr == len)
type = " ^ ";
for (len = 4; len < length; len += hoplen) {
if (ptr == len)
type = " ^ ";
- printf("%s%d@%s", type, ntohl(*(u_int32_t *)&cp[len+hoplen-4]),
+ printf("%s%d@%s", type, EXTRACT_32BITS(&cp[len+hoplen-4]),
hoplen!=8 ? "" : ipaddr_string(&cp[len]));
type = " ";
}
hoplen!=8 ? "" : ipaddr_string(&cp[len]));
type = " ";
}