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

Partial rewrite of fw_sync_with_auth #168

merged 15 commits into from Apr 1, 2015

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 mhaas commented Mar 29, 2015

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

acv added 6 commits Mar 29, 2015
Goal is to eventually have them check and cleanup previous
Mark automatically.
@acv
Copy link
Contributor Author

@acv acv commented Mar 29, 2015

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

@florida63
Copy link
Contributor

@florida63 florida63 commented Mar 29, 2015

I test.

@florida63
Copy link
Contributor

@florida63 florida63 commented Mar 29, 2015

@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.

src/http.c Outdated
@@ -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;

This comment has been minimized.

@mhaas

mhaas Mar 29, 2015
Contributor

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

@acv
Copy link
Contributor Author

@acv 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 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
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@acv acv deleted the acv:refactor-auth branch Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants