]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_lsdb.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / ospfd / ospf_lsdb.c
index 2de4318a81b73dc591b0637a0b0baa71d27e36a9..f39bea97684c1793fe19171ad77a9503c2a41e03 100644 (file)
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -143,19 +142,8 @@ void ospf_lsdb_delete(struct ospf_lsdb *lsdb, struct ospf_lsa *lsa)
        struct prefix_ls lp;
        struct route_node *rn;
 
-       if (!lsdb) {
-               zlog_warn("%s: Called with NULL LSDB", __func__);
-               if (lsa)
-                       zlog_warn("LSA[Type%d:%s]: LSA %p, lsa->lsdb %p",
-                                 lsa->data->type, inet_ntoa(lsa->data->id),
-                                 (void *)lsa, (void *)lsa->lsdb);
+       if (!lsdb || !lsa)
                return;
-       }
-
-       if (!lsa) {
-               zlog_warn("%s: Called with NULL LSA", __func__);
-               return;
-       }
 
        assert(lsa->data->type < OSPF_MAX_LSA);
        table = lsdb->type[lsa->data->type].db;
@@ -214,7 +202,7 @@ struct ospf_lsa *ospf_lsdb_lookup(struct ospf_lsdb *lsdb, struct ospf_lsa *lsa)
        return NULL;
 }
 
-struct ospf_lsa *ospf_lsdb_lookup_by_id(struct ospf_lsdb *lsdb, u_char type,
+struct ospf_lsa *ospf_lsdb_lookup_by_id(struct ospf_lsdb *lsdb, uint8_t type,
                                        struct in_addr id,
                                        struct in_addr adv_router)
 {
@@ -241,7 +229,7 @@ struct ospf_lsa *ospf_lsdb_lookup_by_id(struct ospf_lsdb *lsdb, u_char type,
 }
 
 struct ospf_lsa *ospf_lsdb_lookup_by_id_next(struct ospf_lsdb *lsdb,
-                                            u_char type, struct in_addr id,
+                                            uint8_t type, struct in_addr id,
                                             struct in_addr adv_router,
                                             int first)
 {