Commit 7f2bfdc5 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@10 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent 6c733c89
......@@ -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,6 +548,7 @@ 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");
......
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