summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2007-01-03 16:23:54 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2007-01-03 16:23:54 +0000
commitce0a23254cf4d1648b69d870dad1c6ea5b239cb7 (patch)
treeccfd5a80d3e368c804418ffd99853aef5b9c7dd8
parent1bed790ea804bcbaad818f65e94d808521cf2265 (diff)
radsrv realm routing changes
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@22 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index fe5be41..7ede5e1 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -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;
}