diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-04-02 01:32:46 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2002-04-02 01:32:46 +0000 |
commit | 91e568c7dd2f7aca444d50a1603db4c7ed800eaf (patch) | |
tree | 7a674d1fad4045f52aa37fd192ad529198d40956 /packet-ntp.c | |
parent | 0b99646c9693f99279951017b48e0d40a364c662 (diff) |
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).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5082 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ntp.c')
-rw-r--r-- | packet-ntp.c | 6 |
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], "..."); |