dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/32393 )
Change subject: proto_clnt: use osmo_fd_close to close the socket on connection loss
......................................................................
proto_clnt: use osmo_fd_close to close the socket on connection loss
When the socket is closed due to a connection loss, we currently use
close(). This is not enough since this will not remove the file
descriptor from the select loop. Let's use osmo_fd_close.
Related: OS#5983
Change-Id: I702b944baf2ebbcc84b6a211e245a4a41627bde6
---
M src/proto_clnt.c
1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/93/32393/1
diff --git a/src/proto_clnt.c b/src/proto_clnt.c
index 5b9a467..0a071e8 100644
--- a/src/proto_clnt.c
+++ b/src/proto_clnt.c
@@ -90,7 +90,7 @@
msgb = osmo_e1dp_recv(ofd, NULL);
if (!msgb) {
LOGP(DE1D, LOGL_ERROR, "Lost connection with osmo-e1d control socket.\n");
- close(ofd->fd);
+ osmo_fd_close(&clnt->ctl_fd);
ofd->fd = 0;
goto err;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/32393
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I702b944baf2ebbcc84b6a211e245a4a41627bde6
Gerrit-Change-Number: 32393
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32392 )
Change subject: e1d: do not set fd number to 0 after close
......................................................................
Patch Set 1:
(1 comment)
File src/input/e1d.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/32392/comment/1801b110_1d5cc633
PS1, Line 494: if (bfd->fd <= 0) {
these checks can most probably be changed to <, and the "> 0" also can be changed to ">= 0"?
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32392
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I72e4775135caf4e3727c4f0654a545478c73bb83
Gerrit-Change-Number: 32392
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 20 Apr 2023 15:20:46 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment