From: Arran Cudbard-Bell Date: Fri, 5 Nov 2021 15:29:14 +0000 (-0400) Subject: Don't add status on success X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e9462af1f8eb237c6cac40ef8d22479d8210178;p=thirdparty%2Ffreeradius-server.git Don't add status on success --- diff --git a/src/process/dhcpv6/base.c b/src/process/dhcpv6/base.c index 9a1f5568940..874e4df8558 100644 --- a/src/process/dhcpv6/base.c +++ b/src/process/dhcpv6/base.c @@ -372,14 +372,24 @@ static inline CC_HINT(always_inline) void status_code_add(request_t *request, fr_value_box_t const **code) { fr_pair_t *vp; + fr_value_box_t const *vb; - if (!code) return; + if (!code || !*code) return; + + vb = *code; + + /* + * If it's a success save some bytes + * in the packet and don't bother + * adding the success code. + */ + if (vb->vb_uint16 == 0) return; /* * Don't override user */ if (pair_update_reply(&vp, attr_status_code_value) == 1) return; - fr_value_box_copy(vp, &vp->data, *code); + fr_value_box_copy(vp, &vp->data, vb); } /** Restore our copy of the header fields into the reply list