From: Alan T. DeKok Date: Thu, 1 Apr 2021 13:41:23 +0000 (-0400) Subject: more descriptive errors for people who don't read the documentation X-Git-Tag: release_3_0_24~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbe2f14aa9a2be614ce4eaef8e703c1ef780b454;p=thirdparty%2Ffreeradius-server.git more descriptive errors for people who don't read the documentation --- diff --git a/src/main/map.c b/src/main/map.c index 451a58a15c4..4396ed63edf 100644 --- a/src/main/map.c +++ b/src/main/map.c @@ -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;