From 153bdb3d03542530ed1deccbefc716cb4b699a67 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 28 Jan 2021 14:56:11 -0500 Subject: [PATCH] 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 +---------------------- ospfd/ospfd.c | 9 --------- ospfd/ospfd.h | 2 -- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 66dd9c7ca4..3f4ca44b05 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; } diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index dfb1b44e34..04397d50a5 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -1981,15 +1981,6 @@ struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *ospf, return NULL; } -struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next(struct ospf *ospf, - struct in_addr *addr, int first) -{ - if (ospf == NULL) - return NULL; - - return NULL; -} - int ospf_nbr_nbma_set(struct ospf *ospf, struct in_addr nbr_addr) { struct ospf_nbr_nbma *nbr_nbma; diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h index 9d5aa6a4f9..954a469b68 100644 --- a/ospfd/ospfd.h +++ b/ospfd/ospfd.h @@ -694,8 +694,6 @@ extern void ospf_terminate(void); extern void ospf_nbr_nbma_if_update(struct ospf *, struct ospf_interface *); extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *, struct in_addr); -extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup_next(struct ospf *, - struct in_addr *, int); extern int ospf_oi_count(struct interface *); extern struct ospf_area *ospf_area_new(struct ospf *ospf, -- 2.39.5