]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more descriptive errors for people who don't read the documentation
authorAlan T. DeKok <aland@freeradius.org>
Thu, 1 Apr 2021 13:41:23 +0000 (09:41 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 2 Apr 2021 19:13:06 +0000 (15:13 -0400)
src/main/map.c

index 451a58a15c473c3d1db69042a3d8ac6a4bb466b6..4396ed63edf3c4fc47fcc0d8a1b6e5921d3a6a8b 100644 (file)
@@ -1091,6 +1091,12 @@ int map_to_request(REQUEST *request, vp_map_t const *map, radius_map_getvalue_t
         */
        if (((map->lhs->tmpl_list == PAIR_LIST_COA) ||
             (map->lhs->tmpl_list == PAIR_LIST_DM)) && !request->coa) {
+               if ((request->packet->code == PW_CODE_COA_REQUEST) ||
+                   (request->packet->code == PW_CODE_DISCONNECT_REQUEST)) {
+                       REDEBUG("You cannot do 'update coa' when processing a CoA / Disconnect request.  Use 'update request' instead.");
+                       return -2;
+               }
+
                if (!request_alloc_coa(context)) {
                        REDEBUG("Failed to create a CoA/Disconnect Request message");
                        return -2;