pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/29548 )


Change subject: hnb_read_cb: Store ofd in variable
......................................................................

hnb_read_cb: Store ofd in variable

Change-Id: Ic7058b5a05b0d34b80617006d4e929a523212221
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 5 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/48/29548/1

diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index dd0999c..b824dd3 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -239,6 +239,7 @@
 static int hnb_read_cb(struct osmo_stream_srv *conn)
 {
        struct hnb_context *hnb = osmo_stream_srv_get_data(conn);
+       struct osmo_fd *ofd = osmo_stream_srv_get_ofd(conn);
        struct msgb *msg = msgb_alloc(IUH_MSGB_SIZE, "Iuh rx");
        int rc;

@@ -261,7 +262,7 @@
                        case SCTP_COMM_LOST:
                                LOGHNB(hnb, DMAIN, LOGL_NOTICE,
                                       "sctp_recvmsg(%s) = SCTP_COMM_LOST, 
closing conn\n",
-                                      
osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                                      osmo_sock_get_name2(ofd->fd));
                                osmo_stream_srv_destroy(conn);
                                rc = -1;
                                break;
@@ -274,7 +275,7 @@
                case SCTP_SHUTDOWN_EVENT:
                        LOGHNB(hnb, DMAIN, LOGL_NOTICE,
                               "sctp_recvmsg(%s) = SCTP_SHUTDOWN_EVENT, closing 
conn\n",
-                              
osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                              osmo_sock_get_name2(ofd->fd));
                        osmo_stream_srv_destroy(conn);
                        rc = -1;
                        break;
@@ -288,12 +289,12 @@
                goto out;
        } else if (rc < 0) {
                LOGHNB(hnb, DMAIN, LOGL_ERROR, "Error during 
sctp_recvmsg(%s)\n",
-                      osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                      osmo_sock_get_name2(ofd->fd));
                osmo_stream_srv_destroy(conn);
                goto out;
        } else if (rc == 0) {
                LOGHNB(hnb, DMAIN, LOGL_NOTICE, "Connection closed 
sctp_recvmsg(%s) = 0\n",
-                      osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+                      osmo_sock_get_name2(ofd->fd));
                osmo_stream_srv_destroy(conn);
                rc = -1;
                goto out;

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29548
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ic7058b5a05b0d34b80617006d4e929a523212221
Gerrit-Change-Number: 29548
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to