From: Linux Karlsson Date: Sat, 31 Jul 2010 19:59:50 +0000 (+0200) Subject: [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string... X-Git-Tag: NTP_4_2_6P3_BETA1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9d49cecaea2acb2230d735ad94a00259267f784;p=thirdparty%2Fntp.git [BUG 1597] packet processing ignores RATE KoD packets because of a bug in string comparison. bk: 4c5480b6mazP9IQmjii0VIeQx_vxcQ --- diff --git a/ChangeLog b/ChangeLog index 16e4f9760..3e2f88ded 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ --- + +* [Bug 1597] packet processing ignores RATE KoD packets, because of + a bug in string comparison. + +--- (4.2.6p2) 2010/07/09 Released by Harlan Stenn * [Bug 1581] size_t printf format string mismatches, IRIG string buffers diff --git a/sntp/networking.c b/sntp/networking.c index 92b699cc6..ff9afa13e 100644 --- a/sntp/networking.c +++ b/sntp/networking.c @@ -410,11 +410,11 @@ unusable: ref_char[0], ref_char[1], ref_char[2], ref_char[3]); /* If it's a KOD packet we'll just use the KOD information */ if (ref_char[0] != 'X') { - if (strncmp(ref_char, "DENY", 4)) + if (strncmp(ref_char, "DENY", 4) == 0) return KOD_DEMOBILIZE; - if (strncmp(ref_char, "RSTR", 4)) + if (strncmp(ref_char, "RSTR", 4) == 0) return KOD_DEMOBILIZE; - if (strncmp(ref_char, "RATE", 4)) + if (strncmp(ref_char, "RATE", 4) == 0) return KOD_RATE; /* There are other interesting kiss codes which might be interesting for authentication */ }