]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_interface.c
Merge pull request #3502 from donaldsharp/socket_to_me_baby
[mirror_frr.git] / ospfd / ospf_interface.c
index 23353b3c309f089a3e124ac5ff2ab2fb90bf364d..f1477ba14dc531ad32d3f9fba56515302c85aebe 100644 (file)
@@ -341,10 +341,10 @@ void ospf_if_free(struct ospf_interface *oi)
        route_table_finish(oi->ls_upd_queue);
 
        /* Free any lists that should be freed */
-       list_delete_and_null(&oi->nbr_nbma);
+       list_delete(&oi->nbr_nbma);
 
-       list_delete_and_null(&oi->ls_ack);
-       list_delete_and_null(&oi->ls_ack_direct.ls_ack);
+       list_delete(&oi->ls_ack);
+       list_delete(&oi->ls_ack_direct.ls_ack);
 
        if (IS_DEBUG_OSPF_EVENT)
                zlog_debug("%s: ospf interface %s vrf %s id %u deleted",
@@ -523,9 +523,6 @@ static struct ospf_if_params *ospf_new_if_params(void)
 
        oip = XCALLOC(MTYPE_OSPF_IF_PARAMS, sizeof(struct ospf_if_params));
 
-       if (!oip)
-               return NULL;
-
        UNSET_IF_PARAM(oip, output_cost_cmd);
        UNSET_IF_PARAM(oip, transmit_delay);
        UNSET_IF_PARAM(oip, retransmit_interval);
@@ -548,7 +545,7 @@ static struct ospf_if_params *ospf_new_if_params(void)
 
 void ospf_del_if_params(struct ospf_if_params *oip)
 {
-       list_delete_and_null(&oip->auth_crypt);
+       list_delete(&oip->auth_crypt);
        bfd_info_free(&(oip->bfd_info));
        XFREE(MTYPE_OSPF_IF_PARAMS, oip);
 }
@@ -923,6 +920,23 @@ static void ospf_vl_if_delete(struct ospf_vl_data *vl_data)
        vlink_count--;
 }
 
+/* for a defined area, count the number of configured vl
+ */
+int ospf_vl_count(struct ospf *ospf, struct ospf_area *area)
+{
+       int count = 0;
+       struct ospf_vl_data *vl_data;
+       struct listnode *node;
+
+       for (ALL_LIST_ELEMENTS_RO(ospf->vlinks, node, vl_data)) {
+               if (area
+                   && !IPV4_ADDR_SAME(&vl_data->vl_area_id, &area->area_id))
+                       continue;
+               count++;
+       }
+       return count;
+}
+
 /* Look up vl_data for given peer, optionally qualified to be in the
  * specified area. NULL area returns first found..
  */
@@ -1036,7 +1050,7 @@ static int ospf_vl_set_params(struct ospf_vl_data *vl_data, struct vertex *v)
                 * there should be due to the ospf_spf_has_link() check
                 * in SPF. Lets warn and try pick a link anyway.
                 */
-               zlog_warn("ospf_vl_set_params: No backlink for %s!",
+               zlog_info("ospf_vl_set_params: No backlink for %s!",
                          vl_data->vl_oi->ifp->name);
                for (i = 0; i < ntohs(rl->links); i++) {
                        switch (rl->link[i].type) {