From: Daniel Veillard Date: Fri, 6 Nov 2009 16:47:45 +0000 (+0100) Subject: Repair getIPv4Addr after the ntohl conversion X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=784b5030c171f7d1e1c79a57200b92a78ecfdc46;p=libvirt.git Repair getIPv4Addr after the ntohl conversion * src/util/network.c: getIPv4Addr() got broken when the input network address value got converted from network to host byte order --- diff --git a/src/util/network.c b/src/util/network.c index 56426e712f..aaea436a14 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -33,7 +33,7 @@ static int getIPv4Addr(virSocketAddrPtr addr, virIPv4AddrPtr tab) { val = ntohl(addr->inet4.sin_addr.s_addr); for (i = 0;i < 4;i++) { - (*tab)[i] = val & 0xFF; + (*tab)[3 - i] = val & 0xFF; val >>= 8; }