]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Adding Debugs to dump OSPF DD Seqnumber 5342/head
authorSatheesh Kumar K <sathk@cumulusnetworks.com>
Fri, 8 Nov 2019 06:00:33 +0000 (22:00 -0800)
committerSatheesh Kumar K <sathk@cumulusnetworks.com>
Thu, 14 Nov 2019 09:16:05 +0000 (01:16 -0800)
Recently Lot of issues are seen in  OSPF adjacnecy establishements,
sessions was tear down because of DD Sequence Number mismatch.

adding Debugs to capture Master & slave generated sequence numbers.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
ospfd/ospf_nsm.c
ospfd/ospf_packet.c

index ee27ec094260ec9575044558cb1396b3a244a286..00174b638eaff8c5fe317a6b32b9922f1a1401f4 100644 (file)
@@ -723,6 +723,13 @@ static void nsm_change_state(struct ospf_neighbor *nbr, int state)
 
                nbr->dd_flags =
                        OSPF_DD_FLAG_I | OSPF_DD_FLAG_M | OSPF_DD_FLAG_MS;
+               if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
+                       zlog_info(
+                               "%s: Intializing [DD]: %s with seqnum:%x , flags:%x",
+                               (oi->ospf->name) ? oi->ospf->name
+                                                : VRF_DEFAULT_NAME,
+                               inet_ntoa(nbr->router_id), nbr->dd_seqnum,
+                               nbr->dd_flags);
                ospf_db_desc_send(nbr);
        }
 
index a508ae657fd9bb5830d32eda9b6ccc5640c75848..453135cb4d89a34c8ab1a32c4023fb1478a5ace8 100644 (file)
@@ -1357,6 +1357,14 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
        /* Add event to thread. */
        OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_PacketReceived);
 
+       if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
+               zlog_info(
+                       "%s:Packet[DD]: Neighbor %s state is %s, seq_num:0x%x, local:0x%x",
+                       (oi->ospf->name) ? oi->ospf->name : VRF_DEFAULT_NAME,
+                       inet_ntoa(nbr->router_id),
+                       lookup_msg(ospf_nsm_state_msg, nbr->state, NULL),
+                       ntohl(dd->dd_seqnum), nbr->dd_seqnum);
+
        /* Process DD packet by neighbor status. */
        switch (nbr->state) {
        case NSM_Down:
@@ -3825,6 +3833,12 @@ void ospf_db_desc_send(struct ospf_neighbor *nbr)
                ospf_packet_free(nbr->last_send);
        nbr->last_send = ospf_packet_dup(op);
        monotime(&nbr->last_send_ts);
+       if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
+               zlog_info(
+                       "%s:Packet[DD]: %s DB Desc send with seqnum:%x , flags:%x",
+                       (oi->ospf->name) ? oi->ospf->name : VRF_DEFAULT_NAME,
+                       inet_ntoa(nbr->router_id), nbr->dd_seqnum,
+                       nbr->dd_flags);
 }
 
 /* Re-send Database Description. */
@@ -3839,6 +3853,12 @@ void ospf_db_desc_resend(struct ospf_neighbor *nbr)
 
        /* Hook thread to write packet. */
        OSPF_ISM_WRITE_ON(oi->ospf);
+       if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
+               zlog_info(
+                       "%s:Packet[DD]: %s DB Desc resend with seqnum:%x , flags:%x",
+                       (oi->ospf->name) ? oi->ospf->name : VRF_DEFAULT_NAME,
+                       inet_ntoa(nbr->router_id), nbr->dd_seqnum,
+                       nbr->dd_flags);
 }
 
 /* Send Link State Request. */