From: Arran Cudbard-Bell Date: Wed, 23 May 2018 05:32:21 +0000 (+0600) Subject: Remove more pair_make calls X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b0ee17e5c0bdfe896f8a181cb2c1394c5f487c9;p=thirdparty%2Ffreeradius-server.git Remove more pair_make calls --- diff --git a/src/include/radiusd.h b/src/include/radiusd.h index 81d6af7a94c..1e009d3e355 100644 --- a/src/include/radiusd.h +++ b/src/include/radiusd.h @@ -497,17 +497,6 @@ int paircmp_init(void); void paircmp_free(void); -/* - * Less code == fewer bugs - * - * @param _a attribute - * @param _b value - * @param _c op - */ -#define pair_make_request(_a, _b, _c) fr_pair_make(request->packet, &request->packet->vps, _a, _b, _c) -#define pair_make_reply(_a, _b, _c) fr_pair_make(request->reply, &request->reply->vps, _a, _b, _c) -#define pair_make_config(_a, _b, _c) fr_pair_make(request, &request->control, _a, _b, _c) - /** Allocate a VALUE_PAIR in the request list * * @param[in] _attr allocated. diff --git a/src/main/auth.c b/src/main/auth.c index 7aaef584db6..5f30cc436be 100644 --- a/src/main/auth.c +++ b/src/main/auth.c @@ -650,8 +650,12 @@ skip: if (request->reply->code == FR_CODE_ACCESS_REJECT) { fr_pair_delete_by_num(&request->control, 0, FR_POST_AUTH_TYPE, TAG_ANY); - vp = pair_make_config("Post-Auth-Type", "Reject", T_OP_SET); - if (vp) (void) rad_postauth(request); + + MEM(vp = fr_pair_afrom_num(request, 0, FR_POST_AUTH_TYPE)); + fr_pair_value_from_str(vp, "Reject", -1); + fr_pair_add(&request->control, vp); + + rad_postauth(request); } if (request->reply->code == FR_CODE_ACCESS_ACCEPT) {