summaryrefslogtreecommitdiff
path: root/radsecproxy.c
diff options
context:
space:
mode:
authorvenaas <venaas>2007-01-03 14:38:01 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2007-01-03 14:38:01 +0000
commit7f2bfdc58f00322ac4c612445d3e9622b5d33c0b (patch)
treea566da392400800c513b073127678703c939921d /radsecproxy.c
parent6c733c89f244f5f6260c3f8e96ad93b8d4b4530d (diff)
radsrv realm routing changes
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@10 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r--radsecproxy.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 6933614..e8a50bf 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -478,6 +478,7 @@ struct peer *radsrv(struct request *rq, char *buf, struct peer *from) {
int left;
struct peer *to;
unsigned char newauth[16];
+ char **realm;
code = *(uint8_t *)buf;
id = *(uint8_t *)(buf + 1);
@@ -524,6 +525,17 @@ struct peer *radsrv(struct request *rq, char *buf, struct peer *from) {
TLS peer if UDP, and first UDP peer if TLS */
i = peer_count;
+
+ for (i = 0; i < peer_count; i++) {
+ for (realm = peers[i].realms; realm; realm++) {
+ /* assume test@domain */
+ if (!strcmp(usernameattr + 5, *realm)) {
+ printf("found matching realm: %s, host %s\n", *realm, peers[i].host);
+ break;
+ }
+ }
+ }
+#if 0
switch (from->type) {
case 'U':
for (i = 0; i < peer_count; i++)
@@ -536,7 +548,8 @@ struct peer *radsrv(struct request *rq, char *buf, struct peer *from) {
break;
break;
}
-
+#endif
+
if (i == peer_count) {
printf("radsrv: ignoring request, don't know where to send it\n");
return NULL;