From cfa1bda00b7e1a96e93a3c32bd2a2dc925ff5992 Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Wed, 23 Aug 2006 15:51:15 +0000 Subject: From Toralf Foerster (in bug 1044): Add new primary sources, fix typo. svn path=/trunk/; revision=19007 --- epan/dissectors/packet-ntp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-ntp.c') diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index b7759f5335..f108117630 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -180,6 +180,8 @@ static const struct { { "IRIG", "IRIG-B timecode" }, { "1PPS", "External 1 PPS input" }, { "FREE", "(Internal clock)" }, + { "INIT", "(Initialization)" }, + { "\0\0\0\0", "NULL" }, { NULL, NULL} }; @@ -548,9 +550,9 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags) * higher level server. My decision was to resolve this address. */ refid = tvb_get_ptr(tvb, 12, 4); + buff = ep_alloc(NTP_TS_SIZE); if (stratum <= 1) { - buff=ep_alloc(NTP_TS_SIZE); - g_snprintf (buff, NTP_TS_SIZE, "Unindentified reference source '%.4s'", + g_snprintf (buff, NTP_TS_SIZE, "Unidentified reference source '%.4s'", refid); for (i = 0; primary_sources[i].id; i++) { if (memcmp (refid, primary_sources[i].id, 4) == 0) { @@ -561,7 +563,6 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags) } } else { int buffpos; - buff = ep_alloc(NTP_TS_SIZE); refid_addr = tvb_get_ipv4(tvb, 12); buffpos = g_snprintf(buff, NTP_TS_SIZE, "%s", get_hostname (refid_addr)); if (buffpos >= NTP_TS_SIZE) { -- cgit v1.2.3