]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove more pair_make calls
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 23 May 2018 05:32:21 +0000 (11:32 +0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 23 May 2018 05:32:21 +0000 (11:32 +0600)
src/include/radiusd.h
src/main/auth.c

index 81d6af7a94cb776ef5c7a350648a97cc49e6479b..1e009d3e355bd293a076639c4b4ae762096d85b8 100644 (file)
@@ -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.
index 7aaef584db63c2e22fd723e3bda615e9cd022cc9..5f30cc436bec56e7ff9e1f68a1e90dc36d2c3814 100644 (file)
@@ -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) {