mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 11:18:43 +00:00
Merge pull request #8032 from donaldsharp/dp_uninited
Some bfd valgrind issues
This commit is contained in:
commit
d6b92dded3
@ -703,8 +703,10 @@ static void bfdd_sessions_disable_interface(struct interface *ifp)
|
|||||||
|
|
||||||
TAILQ_FOREACH(bso, &bglobal.bg_obslist, bso_entry) {
|
TAILQ_FOREACH(bso, &bglobal.bg_obslist, bso_entry) {
|
||||||
bs = bso->bso_bs;
|
bs = bso->bso_bs;
|
||||||
if (strcmp(ifp->name, bs->key.ifname))
|
|
||||||
|
if (bs->ifp != ifp)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Skip disabled sessions. */
|
/* Skip disabled sessions. */
|
||||||
if (bs->sock == -1) {
|
if (bs->sock == -1) {
|
||||||
bs->ifp = NULL;
|
bs->ifp = NULL;
|
||||||
|
@ -146,11 +146,11 @@ static void bfd_adj_event(struct isis_adjacency *adj, struct prefix *dst,
|
|||||||
static int isis_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
|
static int isis_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
|
||||||
{
|
{
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
struct prefix dst_ip;
|
struct prefix dst_ip, src_ip;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
ifp = bfd_get_peer_info(zclient->ibuf, &dst_ip, NULL, &status,
|
ifp = bfd_get_peer_info(zclient->ibuf, &dst_ip, &src_ip, &status, NULL,
|
||||||
NULL, vrf_id);
|
vrf_id);
|
||||||
if (!ifp || (dst_ip.family != AF_INET && dst_ip.family != AF_INET6))
|
if (!ifp || (dst_ip.family != AF_INET && dst_ip.family != AF_INET6))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
14
lib/bfd.c
14
lib/bfd.c
@ -224,6 +224,17 @@ struct interface *bfd_get_peer_info(struct stream *s, struct prefix *dp,
|
|||||||
int plen;
|
int plen;
|
||||||
int local_remote_cbit;
|
int local_remote_cbit;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the ifindex lookup fails the
|
||||||
|
* rest of the data in the stream is
|
||||||
|
* not read. All examples of this function
|
||||||
|
* call immediately use the dp->family which
|
||||||
|
* is not good. Ensure we are not using
|
||||||
|
* random data
|
||||||
|
*/
|
||||||
|
memset(dp, 0, sizeof(*dp));
|
||||||
|
memset(sp, 0, sizeof(*sp));
|
||||||
|
|
||||||
/* Get interface index. */
|
/* Get interface index. */
|
||||||
ifindex = stream_getl(s);
|
ifindex = stream_getl(s);
|
||||||
|
|
||||||
@ -249,13 +260,12 @@ struct interface *bfd_get_peer_info(struct stream *s, struct prefix *dp,
|
|||||||
/* Get BFD status. */
|
/* Get BFD status. */
|
||||||
*status = stream_getl(s);
|
*status = stream_getl(s);
|
||||||
|
|
||||||
if (sp) {
|
|
||||||
sp->family = stream_getc(s);
|
sp->family = stream_getc(s);
|
||||||
|
|
||||||
plen = prefix_blen(sp);
|
plen = prefix_blen(sp);
|
||||||
stream_get(&sp->u.prefix, s, plen);
|
stream_get(&sp->u.prefix, s, plen);
|
||||||
sp->prefixlen = stream_getc(s);
|
sp->prefixlen = stream_getc(s);
|
||||||
}
|
|
||||||
local_remote_cbit = stream_getc(s);
|
local_remote_cbit = stream_getc(s);
|
||||||
if (remote_cbit)
|
if (remote_cbit)
|
||||||
*remote_cbit = local_remote_cbit;
|
*remote_cbit = local_remote_cbit;
|
||||||
|
@ -205,14 +205,14 @@ static int ospf_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
|
|||||||
struct ospf_neighbor *nbr = NULL;
|
struct ospf_neighbor *nbr = NULL;
|
||||||
struct route_node *node;
|
struct route_node *node;
|
||||||
struct route_node *n_node;
|
struct route_node *n_node;
|
||||||
struct prefix p;
|
struct prefix p, src_p;
|
||||||
int status;
|
int status;
|
||||||
int old_status;
|
int old_status;
|
||||||
struct bfd_info *bfd_info;
|
struct bfd_info *bfd_info;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
ifp = bfd_get_peer_info(zclient->ibuf, &p, NULL, &status,
|
ifp = bfd_get_peer_info(zclient->ibuf, &p, &src_p, &status, NULL,
|
||||||
NULL, vrf_id);
|
vrf_id);
|
||||||
|
|
||||||
if ((ifp == NULL) || (p.family != AF_INET))
|
if ((ifp == NULL) || (p.family != AF_INET))
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -217,7 +217,7 @@ static int pim_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
|
|||||||
{
|
{
|
||||||
struct interface *ifp = NULL;
|
struct interface *ifp = NULL;
|
||||||
struct pim_interface *pim_ifp = NULL;
|
struct pim_interface *pim_ifp = NULL;
|
||||||
struct prefix p;
|
struct prefix p, src_p;
|
||||||
int status;
|
int status;
|
||||||
char msg[100];
|
char msg[100];
|
||||||
int old_status;
|
int old_status;
|
||||||
@ -227,8 +227,8 @@ static int pim_bfd_interface_dest_update(ZAPI_CALLBACK_ARGS)
|
|||||||
struct listnode *neigh_nextnode = NULL;
|
struct listnode *neigh_nextnode = NULL;
|
||||||
struct pim_neighbor *neigh = NULL;
|
struct pim_neighbor *neigh = NULL;
|
||||||
|
|
||||||
ifp = bfd_get_peer_info(zclient->ibuf, &p, NULL, &status,
|
ifp = bfd_get_peer_info(zclient->ibuf, &p, &src_p, &status, NULL,
|
||||||
NULL, vrf_id);
|
vrf_id);
|
||||||
|
|
||||||
if ((ifp == NULL) || (p.family != AF_INET))
|
if ((ifp == NULL) || (p.family != AF_INET))
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user