]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_packet.c
ospfd: use ospf_get_name() wherever possible
[mirror_frr.git] / ospfd / ospf_packet.c
index 1efdfee3b4972cfddc15f961560ad183ea89e73c..23817d2eab2dd023a0d73bd2cb37a4345738bd2c 100644 (file)
@@ -1031,7 +1031,7 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
        old_state = nbr->state;
 
        /* Add event to thread. */
-       OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_PacketReceived);
+       OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_HelloReceived);
 
        /*  RFC2328  Section 9.5.1
            If the router is not eligible to become Designated Router,
@@ -1375,14 +1375,10 @@ static void ospf_db_desc(struct ip *iph, struct ospf_header *ospfh,
                UNSET_FLAG(dd->options, OSPF_OPTION_O);
        }
 
-       /* 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 %pI4 state is %s, seq_num:0x%x, local:0x%x",
-                       (oi->ospf->name) ? oi->ospf->name : VRF_DEFAULT_NAME,
-                       &nbr->router_id,
+                       ospf_get_name(oi->ospf), &nbr->router_id,
                        lookup_msg(ospf_nsm_state_msg, nbr->state, NULL),
                        ntohl(dd->dd_seqnum), nbr->dd_seqnum);
 
@@ -1620,9 +1616,6 @@ static void ospf_ls_req(struct ip *iph, struct ospf_header *ospfh,
                return;
        }
 
-       /* Add event to thread. */
-       OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_PacketReceived);
-
        /* Neighbor State should be Exchange or later. */
        if (nbr->state != NSM_Exchange && nbr->state != NSM_Loading
            && nbr->state != NSM_Full) {
@@ -1867,9 +1860,6 @@ static void ospf_ls_upd(struct ospf *ospf, struct ip *iph,
                return;
        }
 
-       /* Add event to thread. */
-       OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_PacketReceived);
-
        /* Check neighbor state. */
        if (nbr->state < NSM_Exchange) {
                if (IS_DEBUG_OSPF(nsm, NSM_EVENTS))
@@ -2256,9 +2246,6 @@ static void ospf_ls_ack(struct ip *iph, struct ospf_header *ospfh,
                return;
        }
 
-       /* Add event to thread. */
-       OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_PacketReceived);
-
        if (nbr->state < NSM_Exchange) {
                if (IS_DEBUG_OSPF(nsm, NSM_EVENTS))
                        zlog_debug(
@@ -3891,9 +3878,8 @@ void ospf_db_desc_send(struct ospf_neighbor *nbr)
        if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
                zlog_info(
                        "%s:Packet[DD]: %pI4 DB Desc send with seqnum:%x , flags:%x",
-                       (oi->ospf->name) ? oi->ospf->name : VRF_DEFAULT_NAME,
-                       &nbr->router_id, nbr->dd_seqnum,
-                       nbr->dd_flags);
+                       ospf_get_name(oi->ospf), &nbr->router_id,
+                       nbr->dd_seqnum, nbr->dd_flags);
 }
 
 /* Re-send Database Description. */
@@ -3911,9 +3897,8 @@ void ospf_db_desc_resend(struct ospf_neighbor *nbr)
        if (CHECK_FLAG(oi->ospf->config, OSPF_LOG_ADJACENCY_DETAIL))
                zlog_info(
                        "%s:Packet[DD]: %pI4 DB Desc resend with seqnum:%x , flags:%x",
-                       (oi->ospf->name) ? oi->ospf->name : VRF_DEFAULT_NAME,
-                       &nbr->router_id, nbr->dd_seqnum,
-                       nbr->dd_flags);
+                       ospf_get_name(oi->ospf), &nbr->router_id,
+                       nbr->dd_seqnum, nbr->dd_flags);
 }
 
 /* Send Link State Request. */