[PATCH 1/4] Added new auth policy black-list.

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Wed Sep 18 14:14:31 UTC 2013


On Mon, Sep 16, 2013 at 01:13:02PM +0400, Ivan Kluchnikov wrote:
> +
> +	if (net->auth_policy == GSM_AUTH_POLICY_BLACK_LIST)
> +		authorized = 1;

this causes a segfault in the tests (as there is no network that
we pass). E.g. make check is failing.

On second thought I wonder about the semantic of this patch. E.g.
if I run an accept-all network.. and then switch to a closed
policy. The authorized field will still be 0. But with this change
I can not easily change.

Have you considered using an enum like

enum {
	AUTHORIZED_NOTSET,
	AUTHORIZED_ALLOWED,
	AUTHORIZES_BLACKLISTED,
};


> +		return subscriber->authorized;

		return subscriber->authorized != AUTHORIZES_BLACKLISTED?

doesn't look too bad and one avoids the using net inside the db
code.




More information about the OpenBSC mailing list