From: Arran Cudbard-Bell Date: Fri, 5 May 2017 23:42:55 +0000 (-0400) Subject: Don't copy meta if we're copying the whole box X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbc006fdfbda6c7a522886215ed48193a139e53b;p=thirdparty%2Ffreeradius-server.git Don't copy meta if we're copying the whole box --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 055e2ea6446..60d06277dd0 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -782,6 +782,7 @@ int value_box_hton(value_box_t *dst, value_box_t const *src) switch (src->type) { case PW_TYPE_INTEGER64: dst->datum.integer64 = htonll(src->datum.integer64); + value_box_copy_meta(dst, src); break; /* 4 byte integers */ @@ -789,11 +790,13 @@ int value_box_hton(value_box_t *dst, value_box_t const *src) case PW_TYPE_DATE: case PW_TYPE_SIGNED: dst->datum.integer = htonl(src->datum.integer); + value_box_copy_meta(dst, src); break; /* 2 byte integers */ case PW_TYPE_SHORT: dst->datum.ushort = htons(src->datum.ushort); + value_box_copy_meta(dst, src); break; case PW_TYPE_OCTETS: @@ -805,8 +808,6 @@ int value_box_hton(value_box_t *dst, value_box_t const *src) break; } - value_box_copy_meta(dst, src); - return 0; }