]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #2211 from chiragshah6/ospf_vrf_dev
authorRuss White <russ@riw.us>
Sat, 12 May 2018 10:37:00 +0000 (06:37 -0400)
committerGitHub <noreply@github.com>
Sat, 12 May 2018 10:37:00 +0000 (06:37 -0400)
ospfd: packet fifo init in interface create

ospfd/ospf_interface.c

index 52b954d6a1dfa07a08a5aaffe323441d2a836820..ea31d8c2ca2bbb8f50d6801d0a8750489a9b6c1b 100644 (file)
@@ -263,6 +263,9 @@ struct ospf_interface *ospf_if_new(struct ospf *ospf, struct interface *ifp,
        ospf_opaque_type9_lsa_init(oi);
 
        oi->ospf = ospf;
+
+       ospf_if_stream_set(oi);
+
        QOBJ_REG(oi, ospf_interface);
 
        if (IS_DEBUG_OSPF_EVENT)
@@ -322,6 +325,9 @@ void ospf_if_free(struct ospf_interface *oi)
 {
        ospf_if_down(oi);
 
+       if (oi->obuf)
+               ospf_fifo_free(oi->obuf);
+
        assert(oi->state == ISM_Down);
 
        ospf_opaque_type9_lsa_term(oi);
@@ -496,9 +502,8 @@ void ospf_if_stream_unset(struct ospf_interface *oi)
        struct ospf *ospf = oi->ospf;
 
        if (oi->obuf) {
-               ospf_fifo_free(oi->obuf);
-               oi->obuf = NULL;
-
+               /* flush the interface packet queue */
+               ospf_fifo_flush(oi->obuf);
                /*reset protocol stats */
                ospf_if_reset_stats(oi);
 
@@ -781,7 +786,6 @@ int ospf_if_up(struct ospf_interface *oi)
        if (oi->type == OSPF_IFTYPE_LOOPBACK)
                OSPF_ISM_EVENT_SCHEDULE(oi, ISM_LoopInd);
        else {
-               ospf_if_stream_set(oi);
                OSPF_ISM_EVENT_SCHEDULE(oi, ISM_InterfaceUp);
        }