]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_snmp.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / ospfd / ospf_snmp.c
index 6825be83ac89b007078e9ee369690c771f2d34ec..755634a2f166c5d2d9935351a016a71a7b1b3cc1 100644 (file)
@@ -47,6 +47,7 @@
 #include "ospfd/ospf_flood.h"
 #include "ospfd/ospf_ism.h"
 #include "ospfd/ospf_dump.h"
+#include "ospfd/ospf_route.h"
 #include "ospfd/ospf_zebra.h"
 
 /* OSPF2-MIB. */
@@ -994,7 +995,6 @@ static struct ospf_lsa *ospfLsdbLookup(struct variable *v, oid *name,
                        if (len <= 0)
                                type_next = 1;
                        else {
-                               len = 1;
                                type_next = 0;
                                *type = *offset;
                        }
@@ -1626,7 +1626,7 @@ static struct ospf_interface *ospfIfLookup(struct variable *v, oid *name,
                len = *length - v->namelen;
                if (len >= IN_ADDR_SIZE)
                        len = IN_ADDR_SIZE;
-               if (len <= 0)
+               if (len == 0)
                        ifaddr_next = 1;
 
                oid2in_addr(name + v->namelen, len, ifaddr);
@@ -1990,7 +1990,7 @@ ospfVirtIfLookup(struct variable *v, oid *name, size_t *length,
                first = 0;
 
                len = *length - v->namelen;
-               if (len <= 0)
+               if (len == 0)
                        first = 1;
                if (len > IN_ADDR_SIZE)
                        len = IN_ADDR_SIZE;
@@ -2176,7 +2176,7 @@ static struct ospf_neighbor *ospfNbrLookup(struct variable *v, oid *name,
                first = 0;
                len = *length - v->namelen;
 
-               if (len <= 0)
+               if (len == 0)
                        first = 1;
 
                if (len > IN_ADDR_SIZE)