]> 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 09:57:20 +0000 (11:57 +0200)
src/modules/rlm_preprocess/rlm_preprocess.c

index 2ff95dfe9c3d2bbe3811bf6e52fc274cac1a8d09..9fcbce5e8f98bfa891af04a175e68c4e5f412819 100644 (file)
@@ -205,6 +205,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;
@@ -268,6 +269,19 @@ static void rad_mangle(rlm_preprocess_t *data, REQUEST *request)
                                        PW_SERVICE_TYPE, 0, 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.");
+       }
 }
 
 /*