nbr_nbma->nbr = nbr;
nbr->nbr_nbma = nbr_nbma;
+#ifndef FUZZING
if (nbr_nbma->t_poll)
OSPF_POLL_TIMER_OFF(nbr_nbma->t_poll);
+#endif
nbr->state_change = nbr_nbma->state_change + 1;
}
}
/* New nbr, save the crypto sequence number if necessary */
+#ifndef FUZZING
if (ntohs(ospfh->auth_type) == OSPF_AUTH_CRYPTOGRAPHIC)
nbr->crypt_seqnum = ospfh->u.crypt.crypt_seqnum;
+#endif
/* Configure BFD if interface has it. */
ospf_neighbor_bfd_apply(nbr);
/* Search proper LSA in LSDB. */
find = ospf_lsa_lookup(oi->ospf, oi->area, ls_type, ls_id,
adv_router);
+#ifndef FUZZING
if (find == NULL) {
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_BadLSReq);
list_delete(&ls_upd);
/* Append LSA to update list. */
listnode_add(ls_upd, find);
length += ntohs(find->data->length);
+#endif
size -= OSPF_LSA_KEY_SIZE;
}
+#ifdef FUZZING
+ return;
+#endif
/* Send rest of Link State Update. */
if (listcount(ls_upd) > 0) {
DISCARD_LSA(lsa, 4);
}
+#ifndef FUZZING
/* Actual flooding procedure. */
if (ospf_flood(oi->ospf, nbr, current, lsa)
< 0) /* Trap NSSA later. */
DISCARD_LSA(lsa, 5);
+#endif
continue;
}
/* Adjust size to message length. */
length = ntohs(ospfh->length) - OSPF_HEADER_SIZE;
+#ifdef FUZZING
+ /*
+ * Everything except hellos returns early with no neighbor found, so we
+ * need to make a neighbor
+ */
+ struct prefix p;
+ p.family = AF_INET;
+ p.prefixlen = 24;
+ p.u.prefix4 = iph->ip_src;
+
+ struct ospf_neighbor *n = ospf_nbr_get(oi, ospfh, iph, &p);
+ n->state = NSM_Exchange;
+#endif
+
/* Read rest of the packet and call each sort of packet routine.
*/
switch (ospfh->type) {