Integer fixes #803

Closed
wants to merge 4 commits into
from

Projects

None yet

2 participants

@spbnick
Collaborator
spbnick commented Oct 1, 2014

These four patches deal with integer handling issues.
The first one is speculative, but the others were discovered via test suite failures on s390x and ppc64 hosts.

Change stats for convenience:

14a1830 Don't truncate 64-bit integers in do_cast_copy
 src/main/evaluate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

1e2b64f Access union value_data members consistently
 src/include/libradius.h                       |  1 +
 src/lib/print.c                               | 41 ++++++++++++++++++++++++++++++++++++-----
 src/lib/radius.c                              |  8 ++++----
 src/lib/valuepair.c                           | 35 ++++++++++++++++++++++++++++-------
 src/main/evaluate.c                           |  4 ++--
 src/main/valuepair.c                          |  4 ++++
 src/main/xlat.c                               |  4 +++-
 src/modules/rlm_couchbase/mod.c               |  4 ++--
 src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c |  4 ++--
 9 files changed, 82 insertions(+), 23 deletions(-)

9a7fae8 Prefix *_ENDIAN macros with RADIUS_
 configure                 |  4 ++--
 configure.ac              |  4 ++--
 src/include/autoconf.h.in | 16 ++++++++--------
 src/include/build.h       |  6 +++---
 src/include/missing-h     |  4 ++--
 src/lib/missing.c         |  2 +-
 src/main/version.c        |  4 ++--
 7 files changed, 20 insertions(+), 20 deletions(-)

d1add4b Don't assume little-endian in fr_prints_uint128
 src/lib/misc.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
spbnick added some commits Sep 30, 2014
@spbnick spbnick Don't truncate 64-bit integers in do_cast_copy
Assign converted octets to vp_integer64, instead of vp_integer to avoid
truncation in do_cast_copy.
14a1830
@spbnick spbnick Access union value_data members consistently
Use the same, appropriate union value_data member for each access of
BOOLEAN, BYTE and SHORT PW_TYPEs, without assuming they're
interchangeable with "integer", as that is only true on little-endian
architectures.

This fixes at least this wimax unit test failure on s390x and ppc64:

    Mismatch in line 11 of src/tests/unit/wimax.txt, got: 1a 0c 00 00 60 b5 01 06 00 02 03 00 expected: 1a 0c 00 00 60 b5 01 06 00 02 03 01
6085c79
@spbnick spbnick Prefix *_ENDIAN macros with RADIUS_
Rename LITTLE_ENDIAN and BIG_ENDIAN macros to RADIUS_LITTLE_ENDIAN and
RADIUS_BIG_ENDIAN respectively to avoid clashes with
/usr/include/endian.h defines, which result in always assuming
little-endian architecture.
37f6c74
@spbnick spbnick Don't assume little-endian in fr_prints_uint128
Add handling of big-endian architectures to fr_prints_uint128.
6ddc5f0
@alandekok
Member

I've pulled over the patches with some minor changes. Thanks.

@alandekok alandekok closed this Oct 1, 2014
@spbnick
Collaborator
spbnick commented Oct 1, 2014

Thank you, Alan. I'll run the tests with your changes on our hosts.

Do you happen to have regular access to big-endian hardware to test on?
Would you be interested in having us run tests on ppc64 and s390x, say, once a week and send you reports?

@alandekok
Member

Nikolai Kondrashov wrote:

Thank you, Alan. I'll run the tests with your changes on our hosts.

Do you happen to have regular access to big-endian hardware to test on?

Nope.

Would you be interested in having us run tests on ppc64 and s390x, say,
once a week and send you reports?

Sure. We have a build farm set up, but it's only for x86 / x64 right now.

Alan DeKok.

@spbnick
Collaborator
spbnick commented Oct 1, 2014

On 10/01/2014 07:35 PM, Alan DeKok wrote:

Nikolai Kondrashov wrote:

Would you be interested in having us run tests on ppc64 and s390x, say,
once a week and send you reports?

Sure. We have a build farm set up, but it's only for x86 / x64 right now.

Alright, I'll try to arrange that, or similar, with our QA.

Nick

@spbnick spbnick deleted the spbnick:integer_fixes branch Oct 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment