Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial rewrite of fw_sync_with_auth #168

Merged
merged 15 commits into from Apr 1, 2015
Merged

Conversation

acv
Copy link
Contributor

@acv acv commented Mar 29, 2015

This code needs a lot of testing and probably has remaining bugs but it attempts to avoid being affected by client_list changes in any way.

The trick is that the entire client list gets duplicated and the mutex is dropped and then the copy is processed.

Mutex are re-acquired and the client refound (by mac and ip) before being changed. Explicit checks exist for client that no longer exist.

This aims at resolving #84

@mhaas
Copy link
Contributor

mhaas commented Mar 29, 2015

Damn, you were about 10 seconds faster than me. Just finished my compile :)

@acv
Copy link
Contributor Author

acv commented Mar 29, 2015

Last few commits mostly deal with issue #55 at least in theory

@florida63
Copy link
Contributor

I test.

@florida63
Copy link
Contributor

@acv: It seems avoided duplicates rules when I do multiple connections disconnections. cool :)
However, a logout Takes effect only when the gateway receives updated counters of server.

@Kvncrck: Can you test with lots of user.

Currently no bug.

@@ -269,7 +269,7 @@ http_callback_auth(httpd * webserver, request * r)

if ((client = client_list_find(r->clientAddr, mac)) == NULL) {
debug(LOG_DEBUG, "New client for %s", r->clientAddr);
client_list_append(r->clientAddr, mac, token->value);
client_list_add(r->clientAddr, mac, token->value);
} else if (logout) {
t_authresponse authresponse;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I have noticed here: can't we use logout_client from firewall.c here?

@acv
Copy link
Contributor Author

acv commented Mar 29, 2015

Indeed! Bonus point, the code in firewall.c was cleaner and with better thread safety.

@mhaas
Copy link
Contributor

mhaas commented Apr 1, 2015

Ok, I am all happy now that I have #173.

mhaas added a commit that referenced this pull request Apr 1, 2015
Partial rewrite of fw_sync_with_auth
@mhaas mhaas merged commit 1366520 into wifidog:master Apr 1, 2015
@acv acv deleted the refactor-auth branch April 1, 2015 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants