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.