From 153bdb3d03542530ed1deccbefc716cb4b699a67 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 28 Jan 2021 14:56:11 -0500 Subject: ospfd: ospf_nbr_nbma_lookup_next always returns NULL The calling function of ospf_nbr_nbma_lookup_next calls this function and then immediately returns when it gets the NULL. Just cleanup a bit more code. Signed-off-by: Donald Sharp --- ospfd/ospf_snmp.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'ospfd/ospf_snmp.c') diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 66dd9c7ca..3f4ca44b0 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -1236,7 +1236,6 @@ static struct ospf_nbr_nbma *ospfHostLookup(struct variable *v, oid *name, size_t *length, struct in_addr *addr, int exact) { - int len; struct ospf_nbr_nbma *nbr_nbma; struct ospf *ospf; @@ -1257,29 +1256,9 @@ static struct ospf_nbr_nbma *ospfHostLookup(struct variable *v, oid *name, nbr_nbma = ospf_nbr_nbma_lookup(ospf, *addr); - return nbr_nbma; - } else { - len = *length - v->namelen; - if (len > 4) - len = 4; - - oid2in_addr(name + v->namelen, len, addr); - - nbr_nbma = - ospf_nbr_nbma_lookup_next(ospf, addr, len == 0 ? 1 : 0); - - if (nbr_nbma == NULL) - return NULL; - - oid_copy_addr(name + v->namelen, addr, IN_ADDR_SIZE); - - /* Set TOS 0. */ - name[v->namelen + IN_ADDR_SIZE] = 0; - - *length = v->namelen + IN_ADDR_SIZE + 1; - return nbr_nbma; } + return NULL; } -- cgit v1.2.3