summaryrefslogtreecommitdiffstats
path: root/isisd/isis_bfd.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2020-05-29 22:46:29 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2020-05-31 13:29:54 +0200
commitc2afd32f36d1529d2e3f42b7fbf46e2efadb387b (patch)
tree08cca0912e7642bf8c72408b0510273bd40c971b /isisd/isis_bfd.c
parentbfdd: don't update peers settings on shutdown (diff)
downloadfrr-c2afd32f36d1529d2e3f42b7fbf46e2efadb387b.tar.xz
frr-c2afd32f36d1529d2e3f42b7fbf46e2efadb387b.zip
isisd: check interface pointer before accessing
On some cases (protocol convergence down or daemon exit) we'll have the interface pointer in the circuit as `NULL`, so don't attempt to access it. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'isisd/isis_bfd.c')
-rw-r--r--isisd/isis_bfd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/isisd/isis_bfd.c b/isisd/isis_bfd.c
index 0f0d20e39..a9a1ec7c4 100644
--- a/isisd/isis_bfd.c
+++ b/isisd/isis_bfd.c
@@ -263,9 +263,10 @@ static void bfd_handle_adj_down(struct isis_adjacency *adj)
ZEBRA_BFD_DEST_DEREGISTER);
bfd_peer_sendmsg(zclient, NULL, adj->bfd_session->family,
- &adj->bfd_session->dst_ip,
- &adj->bfd_session->src_ip,
- adj->circuit->interface->name,
+ &adj->bfd_session->dst_ip, &adj->bfd_session->src_ip,
+ (adj->circuit->interface)
+ ? adj->circuit->interface->name
+ : NULL,
0, /* ttl */
0, /* multihop */
1, /* control plane independent bit is on */
@@ -324,7 +325,9 @@ static void bfd_handle_adj_up(struct isis_adjacency *adj, int command)
bfd_peer_sendmsg(zclient, circuit->bfd_info, adj->bfd_session->family,
&adj->bfd_session->dst_ip,
&adj->bfd_session->src_ip,
- circuit->interface->name,
+ (adj->circuit->interface)
+ ? adj->circuit->interface->name
+ : NULL,
0, /* ttl */
0, /* multihop */
1, /* control plane independent bit is on */