mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-trx.git
				synced 2025-11-03 21:53:18 +00:00 
			
		
		
		
	Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: Iffc7d89166be1cf3cd1f8c3effe90f04d5c5a9c1
This commit is contained in:
		@@ -162,9 +162,9 @@ struct ctrl_sock_state {
 | 
			
		||||
  }
 | 
			
		||||
  ~ctrl_sock_state() {
 | 
			
		||||
      if(conn_bfd.fd >= 0) {
 | 
			
		||||
          osmo_fd_unregister(&conn_bfd);
 | 
			
		||||
          close(conn_bfd.fd);
 | 
			
		||||
          conn_bfd.fd = -1;
 | 
			
		||||
          osmo_fd_unregister(&conn_bfd);
 | 
			
		||||
      }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -537,9 +537,9 @@ void IPCDevice::ipc_sock_close(struct ipc_per_trx_sock_state *state)
 | 
			
		||||
 | 
			
		||||
	LOGP(DDEV, LOGL_NOTICE, "IPC socket has LOST connection\n");
 | 
			
		||||
 | 
			
		||||
	osmo_fd_unregister(bfd);
 | 
			
		||||
	close(bfd->fd);
 | 
			
		||||
	bfd->fd = -1;
 | 
			
		||||
	osmo_fd_unregister(bfd);
 | 
			
		||||
 | 
			
		||||
	/* flush the queue */
 | 
			
		||||
	while (!llist_empty(&state->upqueue)) {
 | 
			
		||||
 
 | 
			
		||||
@@ -97,9 +97,9 @@ void ipc_sock_close(struct ipc_sock_state *state)
 | 
			
		||||
 | 
			
		||||
	ipc_exit_requested = 1;
 | 
			
		||||
 | 
			
		||||
	osmo_fd_unregister(bfd);
 | 
			
		||||
	close(bfd->fd);
 | 
			
		||||
	bfd->fd = -1;
 | 
			
		||||
	osmo_fd_unregister(bfd);
 | 
			
		||||
 | 
			
		||||
	/* re-enable the generation of ACCEPT for new connections */
 | 
			
		||||
	osmo_fd_read_enable(&state->listen_bfd);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user