summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_message.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2023-03-17 07:55:09 -0400
committerGitHub <noreply@github.com>2023-03-17 07:55:09 -0400
commit3bf4d3b45d6e97b36e87585de8e69a2ee7c573e2 (patch)
tree0812216930aca72f43040228bde3a21a37cddf0a /ospf6d/ospf6_message.c
parent6c634d2912a52652bb80d1e3e8200637c50d9e1f (diff)
parent386d232a1a706310f4425d1a0ad6f08c32646e10 (diff)
Merge pull request #13016 from opensourcerouting/feature/ospf_logging_upstream_backport
ospfd, ospfd6: Add more logging
Diffstat (limited to 'ospf6d/ospf6_message.c')
-rw-r--r--ospf6d/ospf6_message.c49
1 files changed, 30 insertions, 19 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index b7f261fcf9..a499190a11 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -410,26 +410,29 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst,
/* HelloInterval check */
if (ntohs(hello->hello_interval) != oi->hello_interval) {
zlog_warn(
- "VRF %s: I/F %s HelloInterval mismatch: (my %d, rcvd %d)",
- oi->interface->vrf->name, oi->interface->name,
- oi->hello_interval, ntohs(hello->hello_interval));
+ "VRF %s: I/F %s HelloInterval mismatch from %pI6 (%pI4): (my %d, rcvd %d)",
+ oi->interface->vrf->name, oi->interface->name, src,
+ &oh->router_id, oi->hello_interval,
+ ntohs(hello->hello_interval));
return;
}
/* RouterDeadInterval check */
if (ntohs(hello->dead_interval) != oi->dead_interval) {
zlog_warn(
- "VRF %s: I/F %s DeadInterval mismatch: (my %d, rcvd %d)",
- oi->interface->vrf->name, oi->interface->name,
- oi->dead_interval, ntohs(hello->dead_interval));
+ "VRF %s: I/F %s DeadInterval mismatch from %pI6 (%pI4): (my %d, rcvd %d)",
+ oi->interface->vrf->name, oi->interface->name, src,
+ &oh->router_id, oi->dead_interval,
+ ntohs(hello->dead_interval));
return;
}
/* E-bit check */
- if (OSPF6_OPT_ISSET(hello->options, OSPF6_OPT_E)
- != OSPF6_OPT_ISSET(oi->area->options, OSPF6_OPT_E)) {
- zlog_warn("VRF %s: IF %s E-bit mismatch",
- oi->interface->vrf->name, oi->interface->name);
+ if (OSPF6_OPT_ISSET(hello->options, OSPF6_OPT_E) !=
+ OSPF6_OPT_ISSET(oi->area->options, OSPF6_OPT_E)) {
+ zlog_warn("VRF %s: IF %s E-bit mismatch from %pI6 (%pI4)",
+ oi->interface->vrf->name, oi->interface->name, src,
+ &oh->router_id);
return;
}
@@ -687,8 +690,9 @@ static void ospf6_dbdesc_recv_master(struct ospf6_header *oh,
if (ntohl(dbdesc->seqnum) != on->dbdesc_seqnum) {
zlog_warn(
- "DbDesc recv: Sequence number mismatch Nbr %s (%#lx expected)",
- on->name, (unsigned long)on->dbdesc_seqnum);
+ "DbDesc recv: Sequence number mismatch Nbr %s (received %#lx, %#lx expected)",
+ on->name, (unsigned long)ntohl(dbdesc->seqnum),
+ (unsigned long)on->dbdesc_seqnum);
thread_add_event(master, seqnumber_mismatch, on, 0,
NULL);
return;
@@ -906,8 +910,9 @@ static void ospf6_dbdesc_recv_slave(struct ospf6_header *oh,
if (ntohl(dbdesc->seqnum) != on->dbdesc_seqnum + 1) {
zlog_warn(
- "DbDesc slave recv: Sequence number mismatch Nbr %s (%#lx expected)",
- on->name, (unsigned long)on->dbdesc_seqnum + 1);
+ "DbDesc slave recv: Sequence number mismatch Nbr %s (received %#lx, %#lx expected)",
+ on->name, (unsigned long)ntohl(dbdesc->seqnum),
+ (unsigned long)on->dbdesc_seqnum + 1);
thread_add_event(master, seqnumber_mismatch, on, 0,
NULL);
return;
@@ -1537,20 +1542,25 @@ static int ospf6_rxpacket_examin(struct ospf6_interface *oi,
struct ospf6_header *oh,
const unsigned bytesonwire)
{
+ struct ospf6_neighbor *on;
if (MSG_OK != ospf6_packet_examin(oh, bytesonwire))
return MSG_NG;
+ on = ospf6_neighbor_lookup(oh->router_id, oi);
+
/* Area-ID check */
if (oh->area_id != oi->area->area_id) {
if (oh->area_id == OSPF_AREA_BACKBONE)
zlog_warn(
- "VRF %s: I/F %s Message may be via Virtual Link: not supported",
- oi->interface->vrf->name, oi->interface->name);
+ "VRF %s: I/F %s (%s, Router-ID: %pI4) Message may be via Virtual Link: not supported",
+ oi->interface->vrf->name, oi->interface->name,
+ on ? on->name : "null", &oh->router_id);
else
zlog_warn(
- "VRF %s: I/F %s Area-ID mismatch (my %pI4, rcvd %pI4)",
+ "VRF %s: I/F %s (%s, Router-ID: %pI4) Area-ID mismatch (my %pI4, rcvd %pI4)",
oi->interface->vrf->name, oi->interface->name,
+ on ? on->name : "null", &oh->router_id,
&oi->area->area_id, &oh->area_id);
return MSG_NG;
}
@@ -1558,9 +1568,10 @@ static int ospf6_rxpacket_examin(struct ospf6_interface *oi,
/* Instance-ID check */
if (oh->instance_id != oi->instance_id) {
zlog_warn(
- "VRF %s: I/F %s Instance-ID mismatch (my %u, rcvd %u)",
+ "VRF %s: I/F %s (%s, Router-ID: %pI4) Instance-ID mismatch (my %u, rcvd %u)",
oi->interface->vrf->name, oi->interface->name,
- oi->instance_id, oh->instance_id);
+ on ? on->name : "null", &oh->router_id, oi->instance_id,
+ oh->instance_id);
return MSG_NG;
}