summaryrefslogtreecommitdiff
path: root/packet-ntp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2002-04-02 01:32:46 +0000
committerGuy Harris <guy@alum.mit.edu>2002-04-02 01:32:46 +0000
commit15fc29c820c8879c604f19181fdfe62104d98a9d (patch)
tree7a674d1fad4045f52aa37fd192ad529198d40956 /packet-ntp.c
parent49de302c8468bef63e38d6683e836abc6ea9ab5f (diff)
downloadwireshark-15fc29c820c8879c604f19181fdfe62104d98a9d.tar.gz
Fix a bunch of bits of code that used "tvb_get_ntohl()" to fetch IP
addresses and then tried to compensate for that error using "htonl()" (or didn't bother compensating, in some cases). svn path=/trunk/; revision=5082
Diffstat (limited to 'packet-ntp.c')
-rw-r--r--packet-ntp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/packet-ntp.c b/packet-ntp.c
index 1cb2f13480..a01f30227e 100644
--- a/packet-ntp.c
+++ b/packet-ntp.c
@@ -2,7 +2,7 @@
* Routines for NTP packet dissection
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
*
- * $Id: packet-ntp.c,v 1.34 2002/01/24 09:20:50 guy Exp $
+ * $Id: packet-ntp.c,v 1.35 2002/04/02 01:32:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -265,6 +265,7 @@ dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
double rootdelay;
double rootdispersion;
const guint8 *refid;
+ guint32 refid_addr;
const guint8 *reftime;
const guint8 *org;
const guint8 *rec;
@@ -375,7 +376,8 @@ dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
} else {
buff[sizeof(buff) - 1] = '\0';
- strncpy (buff, get_hostname (htonl(tvb_get_ntohl(tvb, 12))),
+ tvb_memcpy(tvb, (guint8 *)&refid_addr, 12, 4);
+ strncpy (buff, get_hostname (refid_addr),
sizeof(buff));
if (buff[sizeof(buff) - 1] != '\0')
strcpy(&buff[sizeof(buff) - 4], "...");