summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--radsecproxy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index bbecffb..6aa204a 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -478,10 +478,13 @@ struct peer *id2peer(char *id, uint8_t len) {
for (i = 0; i < peer_count; i++) {
for (realm = peers[i].realms; *realm; realm++) {
/* assume test@domain */
- printf("realmlength %d, usernamelenght %d\n", strlen(*realm), len);
- if (strlen(*realm) == len - 5 && !memcmp(id + 5, *realm, len - 5)) {
- printf("found matching realm: %s, host %s\n", *realm, peers[i].host);
+ printf("realmlength %d, usernamelength %d\n", strlen(*realm), len);
+ if (strlen(*realm) == len - 5) {
+ printf("lengths match\n");
+ if (!memcmp(id + 5, *realm, len - 5)) {
+ printf("found matching realm: %s, host %s\n", *realm, peers[i].host);
return peers + i;
+ }
}
}
}