mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 03:27:39 +00:00
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 <sharpd@nvidia.com>
This commit is contained in:
parent
d3e3a408d5
commit
153bdb3d03
@ -1236,7 +1236,6 @@ static struct ospf_nbr_nbma *ospfHostLookup(struct variable *v, oid *name,
|
|||||||
size_t *length,
|
size_t *length,
|
||||||
struct in_addr *addr, int exact)
|
struct in_addr *addr, int exact)
|
||||||
{
|
{
|
||||||
int len;
|
|
||||||
struct ospf_nbr_nbma *nbr_nbma;
|
struct ospf_nbr_nbma *nbr_nbma;
|
||||||
struct ospf *ospf;
|
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);
|
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 nbr_nbma;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1981,15 +1981,6 @@ struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *ospf,
|
|||||||
return NULL;
|
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)
|
int ospf_nbr_nbma_set(struct ospf *ospf, struct in_addr nbr_addr)
|
||||||
{
|
{
|
||||||
struct ospf_nbr_nbma *nbr_nbma;
|
struct ospf_nbr_nbma *nbr_nbma;
|
||||||
|
@ -694,8 +694,6 @@ extern void ospf_terminate(void);
|
|||||||
extern void ospf_nbr_nbma_if_update(struct ospf *, struct ospf_interface *);
|
extern void ospf_nbr_nbma_if_update(struct ospf *, struct ospf_interface *);
|
||||||
extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *,
|
extern struct ospf_nbr_nbma *ospf_nbr_nbma_lookup(struct ospf *,
|
||||||
struct in_addr);
|
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 int ospf_oi_count(struct interface *);
|
||||||
|
|
||||||
extern struct ospf_area *ospf_area_new(struct ospf *ospf,
|
extern struct ospf_area *ospf_area_new(struct ospf *ospf,
|
||||||
|
Loading…
Reference in New Issue
Block a user