Merge pull request #16759 from lsang6WIND/ospf_log

ospfd: logging behavior for area id mismatches
This commit is contained in:
Russ White 2024-09-10 10:18:22 -04:00 committed by GitHub
commit 551469f323
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2806,9 +2806,7 @@ static enum ospf_read_return_enum ospf_read_helper(struct ospf *ospf)
* or header area is backbone but ospf_interface is not * or header area is backbone but ospf_interface is not
* check for VLINK interface * check for VLINK interface
*/ */
if ((oi == NULL) if (oi == NULL) {
|| (OSPF_IS_AREA_ID_BACKBONE(ospfh->area_id)
&& !OSPF_IS_AREA_ID_BACKBONE(oi->area->area_id))) {
if ((oi = ospf_associate_packet_vl(ospf, ifp, iph, ospfh)) if ((oi = ospf_associate_packet_vl(ospf, ifp, iph, ospfh))
== NULL) { == NULL) {
if (!ospf->instance && IS_DEBUG_OSPF_EVENT) if (!ospf->instance && IS_DEBUG_OSPF_EVENT)
@ -2817,6 +2815,15 @@ static enum ospf_read_return_enum ospf_read_helper(struct ospf *ospf)
&iph->ip_src, ifp->name); &iph->ip_src, ifp->name);
return OSPF_READ_CONTINUE; return OSPF_READ_CONTINUE;
} }
} else if (OSPF_IS_AREA_ID_BACKBONE(ospfh->area_id) &&
!OSPF_IS_AREA_ID_BACKBONE(oi->area->area_id)) {
oi = ospf_associate_packet_vl(ospf, ifp, iph, ospfh);
if (oi == NULL) {
flog_warn(EC_OSPF_PACKET,
"interface %s: ospf_read invalid Area ID %pI4",
ifp->name, &ospfh->area_id);
return OSPF_READ_CONTINUE;
}
} }
/* /*