mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 13:57:50 +00:00
Fix an endian bug in trace files (James Brister)
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: icmp.c,v 1.28 2001/02/26 22:21:08 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: icmp.c,v 1.29 2001/03/14 15:56:27 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -277,11 +277,13 @@ isc_result_t icmp_echoreply (h)
|
|||||||
|
|
||||||
#if defined (TRACING)
|
#if defined (TRACING)
|
||||||
if (trace_record ()) {
|
if (trace_record ()) {
|
||||||
|
ia.len = htonl(ia.len);
|
||||||
iov [0].buf = (char *)&ia;
|
iov [0].buf = (char *)&ia;
|
||||||
iov [0].len = sizeof ia;
|
iov [0].len = sizeof ia;
|
||||||
iov [1].buf = (char *)icbuf;
|
iov [1].buf = (char *)icbuf;
|
||||||
iov [1].len = len;
|
iov [1].len = len;
|
||||||
trace_write_packet_iov (trace_icmp_input, 2, iov, MDL);
|
trace_write_packet_iov (trace_icmp_input, 2, iov, MDL);
|
||||||
|
ia.len = ntohl(ia.len);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
(*state -> icmp_handler) (ia, icbuf, len);
|
(*state -> icmp_handler) (ia, icbuf, len);
|
||||||
@@ -296,6 +298,7 @@ void trace_icmp_input_input (trace_type_t *ttype, unsigned length, char *buf)
|
|||||||
unsigned len;
|
unsigned len;
|
||||||
u_int8_t *icbuf;
|
u_int8_t *icbuf;
|
||||||
ia = (struct iaddr *)buf;
|
ia = (struct iaddr *)buf;
|
||||||
|
ia->len = ntohl(ia->len);
|
||||||
icbuf = (u_int8_t *)(ia + 1);
|
icbuf = (u_int8_t *)(ia + 1);
|
||||||
if (icmp_state -> icmp_handler)
|
if (icmp_state -> icmp_handler)
|
||||||
(*icmp_state -> icmp_handler) (*ia, icbuf,
|
(*icmp_state -> icmp_handler) (*ia, icbuf,
|
||||||
|
Reference in New Issue
Block a user