Ethereal-dev: Re: [Ethereal-dev] improved NTP decoding

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 12 Nov 2003 12:47:14 -0800

On Nov 12, 2003, at 4:39 AM, Matthias Drochner wrote:

I'll append a patch which improves NTP decoding. It fixes 2 problems:
-"mode 6" and "mode 7" control packets (as used by ntpq and ntpdc,
 respectively) were not recognized, leading to nonsense
-the code couldn't deal with the new NTP4 autokey extension data;
 everything unknown was labeled "MAC"

Checked in, with some changes:

	I moved the "dissect_ntp_std()" code one tab stop to the left;

I changed "dissect_ntp_ext()" *not* to require that the offset be 48 bytes (dissecting multiple extensions should work fine - at least from the ntpd code I've seen, the correct way to dissect extensions is to keep dissecting until there's less than 20 bytes left in the packet, and that's what you were already doing), and made it return the new offset as its return value rather than returning it through a pointer.