Blame SOURCES/ntp-4.2.6p5-cve-2015-7979.patch

72fc97
diff -up ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2015-7979 ntp-4.2.6p5/ntpd/ntp_proto.c
72fc97
--- ntp-4.2.6p5/ntpd/ntp_proto.c.cve-2015-7979	2016-01-21 14:20:45.760431895 +0100
72fc97
+++ ntp-4.2.6p5/ntpd/ntp_proto.c	2016-01-21 14:46:13.027106826 +0100
72fc97
@@ -1127,7 +1127,8 @@ receive(
72fc97
 		report_event(PEVNT_AUTH, peer, "crypto_NAK");
72fc97
 		peer->flash |= TEST5;		/* bad auth */
72fc97
 		peer->badauth++;
72fc97
-		if (peer->flags & FLAG_PREEMPT) {
72fc97
+		if (peer->flags & FLAG_PREEMPT && hismode != MODE_BROADCAST &&
72fc97
+		    !(peer->flash & (TEST2 | TEST3))) {
72fc97
 			unpeer(peer);
72fc97
 			return;
72fc97
 		}
72fc97
@@ -1153,7 +1154,8 @@ receive(
72fc97
 		if (has_mac &&
72fc97
 		    (hismode == MODE_ACTIVE || hismode == MODE_PASSIVE))
72fc97
 			fast_xmit(rbufp, MODE_ACTIVE, 0, restrict_mask);
72fc97
-		if (peer->flags & FLAG_PREEMPT) {
72fc97
+		if (peer->flags & FLAG_PREEMPT && hismode != MODE_BROADCAST &&
72fc97
+		    !(peer->flash & (TEST2 | TEST3))) {
72fc97
 			unpeer(peer);
72fc97
 			return;
72fc97
 		}