Project

General

Profile

Actions

Bug #5656

closed

osmo-hnbgw doesn't clean up HNB state after they're gone

Added by laforge over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
08/22/2022
Due date:
% Done:

100%

Spec Reference:

Description

I've seen a user report situations where there are thousands of stale hnb_context reported via the VTY. they all show up like:

HNB (no addr) "012345.foo.bar.com" 
MCC 901 MNC 99 LAC 63110 RAC 1 SAC 0 CID 63110 SCTP-stream:HNBAP=0,RUA=0

So somehow a HNB once was registered but the connection has since been severed without us properly cleaning up state.

There's hnb_context_release which gets called in case osmo_stream_srv_recv() returns <= 0. So either there's a bug in our code, or the condition is never hit? The (no addr) should give us some indication of what state we're in: Either ofd == NULL or odf->fd < 0 or osmo_sock_get_name() returns NULL

Assigning to neels, but if osmith wants to take a look, fine, too.

Actions #1

Updated by daniel over 1 year ago

  • Status changed from New to In Progress
  • Assignee changed from neels to daniel

Looking at it
The only place I can see right now is in hnbgw_tx_hnb_register_reg() where we usually call osmo_stream_srv_set_flush_and_destroy() instead of hnb_context_release().

Still need to check whether conn->closed_cb() in osmo-netif is used to call context_release. If not, we should change that

Actions #2

Updated by daniel over 1 year ago

  • % Done changed from 0 to 60

TTCN3 test to reproduce and fix in gerrit:
https://gerrit.osmocom.org/q/topic:os5656

Actions #3

Updated by daniel over 1 year ago

  • % Done changed from 60 to 90

The fix is merged, still waiting for the tests

Actions #4

Updated by daniel over 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Tests are merged

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)