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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b9eece9d912a0da62fa1db91df29b96d624eec4;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 16e4f97607..3e2f88ded4 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 92b699cc6f..ff9afa13e7 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 */ }