]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't copy meta if we're copying the whole box
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 5 May 2017 23:42:55 +0000 (19:42 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 5 May 2017 23:45:10 +0000 (19:45 -0400)
src/lib/util/value.c

index 055e2ea6446d7f023edec71b1c7f0df78e27cc71..60d06277dd037681c0c2212d07690f1637ee4c2e 100644 (file)
@@ -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;
 }