Message ID | gerrit.1464020047297.I53789aad2809e19338ad3b2deb72c4757e7bd524@gerrit.osmocom.org |
---|---|
State | New |
Headers | show |
Patch Set 2: Code-Review+1
Patch Set 2: Code-Review+1
Patch Set 2: Code-Review+2
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c b/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c index 393aea3..e735290 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_filter.c @@ -109,7 +109,7 @@ if (!hdr48) return -1; - req.ctx = bsc; + req.ctx = con; req.black_list = &bsc->nat->imsi_black_list; req.access_lists = &bsc->nat->access_lists; req.local_lst_name = bsc->cfg->acc_lst_name; diff --git a/openbsc/tests/bsc-nat/bsc_nat_test.c b/openbsc/tests/bsc-nat/bsc_nat_test.c index a405763..b531c6b 100644 --- a/openbsc/tests/bsc-nat/bsc_nat_test.c +++ b/openbsc/tests/bsc-nat/bsc_nat_test.c @@ -978,10 +978,13 @@ } memset(&cause, 0, sizeof(cause)); + OSMO_ASSERT(!con->filter_state.imsi); if (bsc_nat_filter_dt(bsc, msg, con, parsed, &cause) != 1) { printf("FAIL: Should have passed..\n"); abort(); } + OSMO_ASSERT(con->filter_state.imsi); + OSMO_ASSERT(talloc_parent(con->filter_state.imsi) == con); /* just some basic length checking... */ for (i = ARRAY_SIZE(id_resp); i >= 0; --i) {