From 01acf7213070583f888764c59babb0972e352357 Mon Sep 17 00:00:00 2001 From: venaas Date: Wed, 3 Jan 2007 15:37:32 +0000 Subject: radsrv realm routing changes git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@19 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- radsecproxy.c | 9 ++++++--- 1 file 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; + } } } } -- cgit v1.1