aboutsummaryrefslogtreecommitdiffstats
path: root/src/hnbgw.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-12-28 21:47:06 +0100
committerHarald Welte <laforge@gnumonks.org>2017-12-28 21:49:59 +0100
commit722a802c79fc40d17e42982412382034e62829ab (patch)
treec754e29b11e2a23420ba3d034490307de4733c18 /src/hnbgw.c
parent39773fd362669ab614c767f4d818200090d93233 (diff)
Reject any HNBAP-REGISTER messages for HNB's with identical CIDlaforge/reject-id-cid
According to some references found in the nano3G MIB help, the CellID as reported in the HNB-REGISTER-REQ is combined from 16-bit CellID and the 12bit RNC-ID. The HNB-GW should use this value in the register-req to ensure it is unique in the network. We should probably reject register requests from non-unique / overlapping values. Change-Id: Ib58cc9f3c0e700f8bc5930f4df0d2dfe7888b991 Closes: OS#2789
Diffstat (limited to 'src/hnbgw.c')
-rw-r--r--src/hnbgw.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hnbgw.c b/src/hnbgw.c
index 752fc0f..af490b5 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -283,6 +283,17 @@ void hnb_context_release(struct hnb_context *ctx)
talloc_free(ctx);
}
+struct hnb_context *hnb_context_find_by_cid(struct hnb_gw *gw, uint32_t cid)
+{
+ struct hnb_context *ctx;
+
+ llist_for_each_entry(ctx, &gw->hnb_list, list) {
+ if (ctx->id.cid == cid)
+ return ctx;
+ }
+ return NULL;
+}
+
/*! call-back when the listen FD has something to read */
static int accept_cb(struct osmo_stream_srv_link *srv, int fd)
{