]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
WARNING on potential proxy loop
authorAlan T. DeKok <aland@freeradius.org>
Wed, 14 Sep 2011 09:56:24 +0000 (11:56 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 14 Sep 2011 10:05:26 +0000 (12:05 +0200)
src/modules/rlm_preprocess/rlm_preprocess.c

index 6a866ee5df580192f111dd9c4b45895aa16c7141..f4da35ed8d291a43bfcb89179480cc1e82213272 100644 (file)
@@ -207,6 +207,7 @@ static void alvarion_vsa_hack(VALUE_PAIR *vp)
  */
 static void rad_mangle(rlm_preprocess_t *data, REQUEST *request)
 {
+       int             num_proxy_state;
        VALUE_PAIR      *namepair;
        VALUE_PAIR      *request_pairs;
        VALUE_PAIR      *tmp;
@@ -270,6 +271,19 @@ static void rad_mangle(rlm_preprocess_t *data, REQUEST *request)
                                        PW_SERVICE_TYPE, PW_TYPE_INTEGER);
                tmp->vp_integer = PW_FRAMED_USER;
        }
+
+       num_proxy_state = 0;
+       for (tmp = request->packet->vps; tmp != NULL; tmp = tmp->next) {
+               if (tmp->vendor != 0) continue;
+               if (tmp->attribute != PW_PROXY_STATE) continue;
+
+               num_proxy_state++;
+       }
+
+       if (num_proxy_state > 10) {
+               DEBUG("WARNING: There are more than 10 Proxy-State attributes in the request.");
+               DEBUG("WARNING: You have likely configured an infinite proxy loop.");
+       }
 }
 
 /*