Merge pull request #8102 from volta-networks/fix_ospf6_error_logs

ospf6d: Update logs that indicate why ospf6 adjacency is not coming up.
This commit is contained in:
Donald Sharp 2021-02-19 08:22:47 -05:00 committed by GitHub
commit ba877ace25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,23 +239,30 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst,
/* HelloInterval check */ /* HelloInterval check */
if (ntohs(hello->hello_interval) != oi->hello_interval) { if (ntohs(hello->hello_interval) != oi->hello_interval) {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) zlog_warn(
zlog_debug("HelloInterval mismatch"); "VRF %s: I/F %s HelloInterval mismatch: (my %d, rcvd %d)",
vrf_id_to_name(oi->interface->vrf_id),
oi->interface->name, oi->hello_interval,
ntohs(hello->hello_interval));
return; return;
} }
/* RouterDeadInterval check */ /* RouterDeadInterval check */
if (ntohs(hello->dead_interval) != oi->dead_interval) { if (ntohs(hello->dead_interval) != oi->dead_interval) {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) zlog_warn(
zlog_debug("RouterDeadInterval mismatch"); "VRF %s: I/F %s DeadInterval mismatch: (my %d, rcvd %d)",
vrf_id_to_name(oi->interface->vrf_id),
oi->interface->name, oi->dead_interval,
ntohs(hello->dead_interval));
return; return;
} }
/* E-bit check */ /* E-bit check */
if (OSPF6_OPT_ISSET(hello->options, OSPF6_OPT_E) if (OSPF6_OPT_ISSET(hello->options, OSPF6_OPT_E)
!= OSPF6_OPT_ISSET(oi->area->options, OSPF6_OPT_E)) { != OSPF6_OPT_ISSET(oi->area->options, OSPF6_OPT_E)) {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) zlog_warn("VRF %s: IF %s E-bit mismatch",
zlog_debug("E-bit mismatch"); vrf_id_to_name(oi->interface->vrf_id),
oi->interface->name);
return; return;
} }
@ -385,8 +392,10 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
memcpy(on->options, dbdesc->options, memcpy(on->options, dbdesc->options,
sizeof(on->options)); sizeof(on->options));
} else { } else {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) zlog_warn(
zlog_debug("Negotiation failed"); "VRF %s: Nbr %s: Negotiation failed",
vrf_id_to_name(on->ospf6_if->interface->vrf_id),
on->name);
return; return;
} }
/* fall through to exchange */ /* fall through to exchange */
@ -599,8 +608,10 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
memcpy(on->options, dbdesc->options, memcpy(on->options, dbdesc->options,
sizeof(on->options)); sizeof(on->options));
} else { } else {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) zlog_warn(
zlog_debug("Negotiation failed"); "VRF %s: Nbr %s Negotiation failed",
vrf_id_to_name(on->ospf6_if->interface->vrf_id),
on->name);
return; return;
} }
break; break;
@ -765,8 +776,9 @@ static void ospf6_dbdesc_recv(struct in6_addr *src, struct in6_addr *dst,
/* Interface MTU check */ /* Interface MTU check */
if (!oi->mtu_ignore && ntohs(dbdesc->ifmtu) != oi->ifmtu) { if (!oi->mtu_ignore && ntohs(dbdesc->ifmtu) != oi->ifmtu) {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) zlog_warn("VRF %s: I/F %s MTU mismatch (my %d rcvd %d)",
zlog_debug("I/F MTU mismatch"); vrf_id_to_name(oi->interface->vrf_id),
oi->interface->name, oi->ifmtu, ntohs(dbdesc->ifmtu));
return; return;
} }
@ -1316,34 +1328,37 @@ static int ospf6_rxpacket_examin(struct ospf6_interface *oi,
/* Area-ID check */ /* Area-ID check */
if (oh->area_id != oi->area->area_id) { if (oh->area_id != oi->area->area_id) {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) { if (oh->area_id == OSPF_AREA_BACKBONE)
if (oh->area_id == OSPF_AREA_BACKBONE) zlog_warn(
zlog_debug( "VRF %s: I/F %s Message may be via Virtual Link: not supported",
"%s: Message may be via Virtual Link: not supported", vrf_id_to_name(oi->interface->vrf_id),
__func__); oi->interface->name);
else else
zlog_debug( zlog_warn(
"%s: Area-ID mismatch (my %s, rcvd %s)", "VRF %s: I/F %s Area-ID mismatch (my %s, rcvd %s)",
__func__, vrf_id_to_name(oi->interface->vrf_id),
inet_ntop(AF_INET, &oi->area->area_id, oi->interface->name,
buf[0], INET_ADDRSTRLEN), inet_ntop(AF_INET, &oi->area->area_id, buf[0],
inet_ntop(AF_INET, &oh->area_id, buf[1], INET_ADDRSTRLEN),
INET_ADDRSTRLEN)); inet_ntop(AF_INET, &oh->area_id, buf[1],
} INET_ADDRSTRLEN));
return MSG_NG; return MSG_NG;
} }
/* Instance-ID check */ /* Instance-ID check */
if (oh->instance_id != oi->instance_id) { if (oh->instance_id != oi->instance_id) {
if (IS_OSPF6_DEBUG_MESSAGE(oh->type, RECV)) zlog_warn(
zlog_debug("%s: Instance-ID mismatch (my %u, rcvd %u)", "VRF %s: I/F %s Instance-ID mismatch (my %u, rcvd %u)",
__func__, oi->instance_id, oh->instance_id); vrf_id_to_name(oi->interface->vrf_id),
oi->interface->name, oi->instance_id, oh->instance_id);
return MSG_NG; return MSG_NG;
} }
/* Router-ID check */ /* Router-ID check */
if (oh->router_id == oi->area->ospf6->router_id) { if (oh->router_id == oi->area->ospf6->router_id) {
zlog_warn("%s: Duplicate Router-ID (%s)", __func__, zlog_warn("VRF %s: I/F %s Duplicate Router-ID (%s)",
vrf_id_to_name(oi->interface->vrf_id),
oi->interface->name,
inet_ntop(AF_INET, &oh->router_id, buf[0], inet_ntop(AF_INET, &oh->router_id, buf[0],
INET_ADDRSTRLEN)); INET_ADDRSTRLEN));
return MSG_NG; return MSG_NG;