Wireshark-bugs: [Wireshark-bugs] [Bug 1233] New: packet-ntp.c : fix bug in switch { }

Date: Fri, 17 Nov 2006 15:23:30 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1233

           Summary: packet-ntp.c : fix bug in switch { }
           Product: Wireshark
           Version: SVN
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: toralf.foerster@xxxxxx


Build Information:
Version 0.99.5 (SVN Rev 19920)

Copyright 1998-2006 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GTK+ 2.8.19, with GLib 2.10.3, with libpcap 0.9.4, with libz
1.2.3, with libpcre 6.6, with Net-SNMP 5.2.1.2, without ADNS, without Lua, with
GnuTLS 1.4.4, with Gcrypt 1.2.2, without Kerberos, without PortAudio, without
AirPcap.

Running on Linux 2.6.18-gentoo-r2, with libpcap version 0.9.4.

Built using gcc 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9).

Wireshark is Open Source Software released under the GNU General Public
License.

Check the man page and http://www.wireshark.org for more information.
--
The patch includes a fix to put the "defeault:" condition at the end of the
switch construct.
BTW I added 2 more cases.


Index: packet-ntp.c
===================================================================
--- packet-ntp.c        (revision 1586)
+++ packet-ntp.c        (working copy)
@@ -429,8 +429,12 @@

        flags = tvb_get_guint8(tvb, 0);
        switch (flags & NTP_MODE_MASK) {
-       default:
-               infostr = "NTP";
+       case NTP_MODE_CLIENT:
+               infostr = "NTP client";
+               dissector = dissect_ntp_std;
+               break;
+       case NTP_MODE_SERVER:
+               infostr = "NTP server";
                dissector = dissect_ntp_std;
                break;
        case NTP_MODE_CTRL:
@@ -441,6 +445,10 @@
                infostr = "NTP private";
                dissector = dissect_ntp_priv;
                break;
+       default:
+               infostr = "NTP";
+               dissector = dissect_ntp_std;
+               break;
        }

        if (check_col(pinfo->cinfo, COL_INFO))


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.