mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc.git
synced 2025-10-23 08:22:19 +00:00
cbsp/sbcap: Set link fsm id with peer's name
Otherwise the id is left unset. Change-Id: I8a6850293cbe01c66e4fb545d646d63743ddaecb
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
struct cbc_cbsp_link *cbc_cbsp_link_alloc(struct cbc_cbsp_mgr *cbc, struct cbc_peer *peer)
|
struct cbc_cbsp_link *cbc_cbsp_link_alloc(struct cbc_cbsp_mgr *cbc, struct cbc_peer *peer)
|
||||||
{
|
{
|
||||||
struct cbc_cbsp_link *link;
|
struct cbc_cbsp_link *link;
|
||||||
|
char *name;
|
||||||
|
|
||||||
link = talloc_zero(cbc, struct cbc_cbsp_link);
|
link = talloc_zero(cbc, struct cbc_cbsp_link);
|
||||||
OSMO_ASSERT(link);
|
OSMO_ASSERT(link);
|
||||||
@@ -48,12 +49,15 @@ struct cbc_cbsp_link *cbc_cbsp_link_alloc(struct cbc_cbsp_mgr *cbc, struct cbc_p
|
|||||||
link->peer = peer;
|
link->peer = peer;
|
||||||
link->is_client = (peer->link_mode == CBC_PEER_LINK_MODE_CLIENT);
|
link->is_client = (peer->link_mode == CBC_PEER_LINK_MODE_CLIENT);
|
||||||
|
|
||||||
link->fi = osmo_fsm_inst_alloc(&cbsp_link_fsm, link, link, LOGL_DEBUG, NULL);
|
name = talloc_strdup(link, peer->name);
|
||||||
|
osmo_identifier_sanitize_buf(name, NULL, '_');
|
||||||
|
link->fi = osmo_fsm_inst_alloc(&cbsp_link_fsm, link, link, LOGL_DEBUG, name);
|
||||||
if (!link->fi) {
|
if (!link->fi) {
|
||||||
LOGPCC(link, LOGL_ERROR, "Unable to allocate FSM\n");
|
LOGPCC(link, LOGL_ERROR, "Unable to allocate FSM\n");
|
||||||
talloc_free(link);
|
talloc_free(link);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
talloc_free(name);
|
||||||
|
|
||||||
llist_add_tail(&link->list, &cbc->links);
|
llist_add_tail(&link->list, &cbc->links);
|
||||||
return link;
|
return link;
|
||||||
|
@@ -46,6 +46,7 @@
|
|||||||
struct cbc_sbcap_link *cbc_sbcap_link_alloc(struct cbc_sbcap_mgr *cbc, struct cbc_peer *peer)
|
struct cbc_sbcap_link *cbc_sbcap_link_alloc(struct cbc_sbcap_mgr *cbc, struct cbc_peer *peer)
|
||||||
{
|
{
|
||||||
struct cbc_sbcap_link *link;
|
struct cbc_sbcap_link *link;
|
||||||
|
char *name;
|
||||||
|
|
||||||
link = talloc_zero(cbc, struct cbc_sbcap_link);
|
link = talloc_zero(cbc, struct cbc_sbcap_link);
|
||||||
OSMO_ASSERT(link);
|
OSMO_ASSERT(link);
|
||||||
@@ -53,12 +54,15 @@ struct cbc_sbcap_link *cbc_sbcap_link_alloc(struct cbc_sbcap_mgr *cbc, struct cb
|
|||||||
link->peer = peer;
|
link->peer = peer;
|
||||||
link->is_client = (peer->link_mode == CBC_PEER_LINK_MODE_CLIENT);
|
link->is_client = (peer->link_mode == CBC_PEER_LINK_MODE_CLIENT);
|
||||||
|
|
||||||
link->fi = osmo_fsm_inst_alloc(&sbcap_link_fsm, link, link, LOGL_DEBUG, NULL);
|
name = talloc_strdup(link, peer->name);
|
||||||
|
osmo_identifier_sanitize_buf(name, NULL, '_');
|
||||||
|
link->fi = osmo_fsm_inst_alloc(&sbcap_link_fsm, link, link, LOGL_DEBUG, name);
|
||||||
if (!link->fi) {
|
if (!link->fi) {
|
||||||
LOGPSBCAPC(link, LOGL_ERROR, "Unable to allocate FSM\n");
|
LOGPSBCAPC(link, LOGL_ERROR, "Unable to allocate FSM\n");
|
||||||
talloc_free(link);
|
talloc_free(link);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
talloc_free(name);
|
||||||
|
|
||||||
llist_add_tail(&link->list, &cbc->links);
|
llist_add_tail(&link->list, &cbc->links);
|
||||||
return link;
|
return link;
|
||||||
|
Reference in New Issue
Block a user