mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 18:46:13 +00:00
Merge pull request #4155 from pguibert6WIND/bfd_increase_config
bfdd: avoid having bfd config inherited from operation context
This commit is contained in:
commit
a34fd5b9f1
@ -166,6 +166,7 @@ enum bfd_session_flags {
|
|||||||
* expires
|
* expires
|
||||||
*/
|
*/
|
||||||
BFD_SESS_FLAG_SHUTDOWN = 1 << 7, /* disable BGP peer function */
|
BFD_SESS_FLAG_SHUTDOWN = 1 << 7, /* disable BGP peer function */
|
||||||
|
BFD_SESS_FLAG_CONFIG = 1 << 8, /* Session configured with bfd NB API */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BFD_SET_FLAG(field, flag) (field |= flag)
|
#define BFD_SET_FLAG(field, flag) (field |= flag)
|
||||||
|
@ -158,6 +158,12 @@ DEFUN_NOSH(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG)) {
|
||||||
|
if (bs->refcount)
|
||||||
|
vty_out(vty, "%% session peer is now configurable via bfd daemon.\n");
|
||||||
|
BFD_SET_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
VTY_PUSH_CONTEXT(BFD_PEER_NODE, bs);
|
VTY_PUSH_CONTEXT(BFD_PEER_NODE, bs);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
@ -984,6 +990,9 @@ static void _bfdd_peer_write_config_iter(struct hash_bucket *hb, void *arg)
|
|||||||
struct vty *vty = arg;
|
struct vty *vty = arg;
|
||||||
struct bfd_session *bs = hb->data;
|
struct bfd_session *bs = hb->data;
|
||||||
|
|
||||||
|
if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG))
|
||||||
|
return;
|
||||||
|
|
||||||
_bfdd_peer_write_config(vty, bs);
|
_bfdd_peer_write_config(vty, bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,6 +431,10 @@ static void bfdd_dest_deregister(struct stream *msg)
|
|||||||
/* Unregister client peer notification. */
|
/* Unregister client peer notification. */
|
||||||
pcn = pcn_lookup(pc, bs);
|
pcn = pcn_lookup(pc, bs);
|
||||||
pcn_free(pcn);
|
pcn_free(pcn);
|
||||||
|
if (bs->refcount ||
|
||||||
|
BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG))
|
||||||
|
return;
|
||||||
|
ptm_bfd_ses_del(&bpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user