pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/31899 )
Change subject: mgcp-client: Call osmo_fd_unregister() before closing and changing bfd->fd ......................................................................
mgcp-client: Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: I95fbcc21a18cadd2c06608cc39b9fe8e12c8bccf --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 11 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 81847ee..4dd278f 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -907,10 +907,10 @@ wq = &mgcp->wq; osmo_wqueue_clear(wq); LOGPMGW(mgcp, LOGL_INFO, "MGCP association: %s -- closed!\n", osmo_sock_get_name2(wq->bfd.fd)); - close(wq->bfd.fd); - wq->bfd.fd = -1; if (osmo_fd_is_registered(&wq->bfd)) osmo_fd_unregister(&wq->bfd); + close(wq->bfd.fd); + wq->bfd.fd = -1; }
/*! Get the IP-Aaddress of the associated MGW as string.