From bf17d38dab2ac3b8838083d9c8eceb987d33bf5d Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Sat, 15 Feb 2014 15:57:40 +0100 Subject: [PATCH] On big endian platforms with type long >32bit the range option applied a bad base address --- CHANGES | 3 +++ xio-ip4.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index fe9487f..58bbd71 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,9 @@ corrections: Changed some variable definitions to make gcc -O2 aliasing checker happy Thanks to Ilya Gordeev for reporting these warnings + On big endian platforms with type long >32bit the range option applied a + bad base address. Thanks to hejia hejia for reporting and fixing this bug. + porting: Performed changes for Fedora release 19 diff --git a/xio-ip4.c b/xio-ip4.c index 076ce1f..a02623e 100644 --- a/xio-ip4.c +++ b/xio-ip4.c @@ -1,5 +1,5 @@ /* source: xio-ip4.c */ -/* Copyright Gerhard Rieger 2001-2008 */ +/* Copyright Gerhard Rieger */ /* Published under the GNU General Public License V.2, see file COPYING */ /* this file contains the source for IP4 related functions */ @@ -55,7 +55,7 @@ int xioparsenetwork_ip4(const char *rangename, struct xiorange *range) { free(rangename1); return STAT_NORETRY; } - netaddr_in->s_addr = *(unsigned long *)nameaddr->h_addr_list[0]; + netaddr_in->s_addr = *(uint32_t *)nameaddr->h_addr_list[0]; } free(rangename1); return STAT_OK;