Commit ce0a2325 authored by venaas's avatar venaas Committed by venaas
Browse files

radsrv realm routing changes

git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@22 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent 1bed790e
......@@ -476,13 +476,17 @@ struct peer *id2peer(char *id, uint8_t len) {
char **realm, *idrealm;
idrealm = strchr(id, '@');
if (idrealm)
if (idrealm) {
idrealm++;
len -= idrealm - id;
len -= idrealm - id;
} else {
idrealm = "-";
len = 1;
}
for (i = 0; i < peer_count; i++) {
for (realm = peers[i].realms; *realm; realm++) {
printf("realm len %d\n", len);
if (strlen(*realm) == len && !memcmp(idrealm, *realm, len)) {
if ((strlen(*realm) == 1 && **realm == '*') ||
(strlen(*realm) == len && !memcmp(idrealm, *realm, len))) {
printf("found matching realm: %s, host %s\n", *realm, peers[i].host);
return peers + i;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment