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) { ...@@ -478,6 +478,7 @@ struct peer *radsrv(struct request *rq, char *buf, struct peer *from) {
int left; int left;
struct peer *to; struct peer *to;
unsigned char newauth[16]; unsigned char newauth[16];
char **realm;
code = *(uint8_t *)buf; code = *(uint8_t *)buf;
id = *(uint8_t *)(buf + 1); id = *(uint8_t *)(buf + 1);
...@@ -524,6 +525,17 @@ struct peer *radsrv(struct request *rq, char *buf, struct peer *from) { ...@@ -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 */ TLS peer if UDP, and first UDP peer if TLS */
i = peer_count; 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) { switch (from->type) {
case 'U': case 'U':
for (i = 0; i < peer_count; i++) for (i = 0; i < peer_count; i++)
...@@ -536,7 +548,8 @@ struct peer *radsrv(struct request *rq, char *buf, struct peer *from) { ...@@ -536,7 +548,8 @@ struct peer *radsrv(struct request *rq, char *buf, struct peer *from) {
break; break;
break; break;
} }
#endif
if (i == peer_count) { if (i == peer_count) {
printf("radsrv: ignoring request, don't know where to send it\n"); printf("radsrv: ignoring request, don't know where to send it\n");
return NULL; return NULL;
......
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