Look for Virtual-Server in configuration items. If found,
authoraland <aland>
Sat, 23 Jun 2007 14:03:51 +0000 (14:03 +0000)
committeraland <aland>
Sat, 23 Jun 2007 14:03:51 +0000 (14:03 +0000)
run the tunneled request through that virtual server.  If not
found, use the parents server.

This is SO much better than what was there before... none of
the "FreeRADIUS-Proxied-To" stuff is necessary any more, and
the inner tunnel sessions can be completely separated from the
outer tunnel sessions

src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c

index 7acfdad..779f884 100644 (file)
@@ -1143,13 +1143,19 @@ int eapttls_process(EAP_HANDLER *handler, tls_session_t *tls_session)
                }
        }
 
+       if ((vp = pairfind(request->config_items, PW_VIRTUAL_SERVER)) != NULL) {
+               fake->server = vp->vp_strvalue;
+       }
+
 #ifndef NDEBUG
        if (debug_flag > 0) {
-         printf("  TTLS: Sending tunneled request\n");
+               printf("  TTLS: Sending tunneled request\n");
+
+               for (vp = fake->packet->vps; vp != NULL; vp = vp->next) {
+                       putchar('\t');vp_print(stdout, vp);putchar('\n');
+               }
 
-         for (vp = fake->packet->vps; vp != NULL; vp = vp->next) {
-           putchar('\t');vp_print(stdout, vp);putchar('\n');
-         }
+               printf("server %s {\n", fake->server);
        }
 #endif
 
@@ -1165,12 +1171,14 @@ int eapttls_process(EAP_HANDLER *handler, tls_session_t *tls_session)
         */
 #ifndef NDEBUG
        if (debug_flag > 0) {
-         printf("  TTLS: Got tunneled reply RADIUS code %d\n",
-                fake->reply->code);
+               printf("} # server %s\n", fake->server);
 
-         for (vp = fake->reply->vps; vp != NULL; vp = vp->next) {
-           putchar('\t');vp_print(stdout, vp);putchar('\n');
-         }
+               printf("  TTLS: Got tunneled reply RADIUS code %d\n",
+                      fake->reply->code);
+               
+               for (vp = fake->reply->vps; vp != NULL; vp = vp->next) {
+                       putchar('\t');vp_print(stdout, vp);putchar('\n');
+               }
        }
 #endif