hisleap = PKT_LEAP(pkt->li_vn_mode);
hismode = (int)PKT_MODE(pkt->li_vn_mode);
hisstratum = PKT_TO_STRATUM(pkt->stratum);
+
+ /* See basic mode and broadcast checks, below */
INSIST(0 != hisstratum);
if (restrict_mask & RES_IGNORE) {
* see if this is an interleave broadcast packet until after
* we've validated the MAC that SHOULD be provided.
*
- * hisstratum should never be 0.
+ * hisstratum cannot be 0 - see assertion above.
* If hisstratum is 15, then we'll advertise as UNSPEC but
* at least we'll be able to sync with the broadcast server.
*/
} else if (hismode == MODE_BROADCAST) {
- if ( 0 == hisstratum
- || STRATUM_UNSPEC <= hisstratum) {
+ /* 0 is unexpected too, and impossible */
+ if (STRATUM_UNSPEC <= hisstratum) {
/* Is this a ++sys_declined or ??? */
msyslog(LOG_INFO,
"receive: Unexpected stratum (%d) in broadcast from %s",
*
* This could also mean somebody is forging packets claiming to
* be from us, attempting to cause our server to KoD us.
+ *
+ * We have earlier asserted that hisstratum cannot be 0.
+ * If hisstratum is STRATUM_UNSPEC, it means he's not sync'd.
*/
} else if (peer->flip == 0) {
- INSIST(0 != hisstratum);
- INSIST(STRATUM_UNSPEC != hisstratum);
-
if (0) {
} else if (L_ISZERO(&p_org)) {
const char *action;