Author: viethen Date: Fri Apr 8 02:42:41 2011 New Revision: 2525 Log: Revert my previous decision to apply little endian-like behaviour for the conversion of the hash value to an IP address: ever since my recent changes to adjust_ip_to_bounds(), the IP address that this whole algorithm generates for a MAC address will have to be quite a different one, anyway. Accordingly, there's no need to maintain compatibility to a previously- evaluated version any longer, so better make sure the hash value gets converted to an IP address in network byte order. Modified: trunk/tools/dhcp/mac2ip.c Modified: trunk/tools/dhcp/mac2ip.c ============================================================================== --- trunk/tools/dhcp/mac2ip.c Fri Apr 8 02:31:48 2011 (r2524) +++ trunk/tools/dhcp/mac2ip.c Fri Apr 8 02:42:41 2011 (r2525) @@ -64,15 +64,11 @@ /* hash it! */ hash = jenkins_one_at_a_time_hash(mac_duplicate.x, sizeof(mac_duplicate.x)); - /* store the hash value in LSB-first order (the previous version of this - * code relied on a platform's endianness and was evaluated on the LE x86_64 - * platform, so we emulate this behaviour now for all platforms independent - * of their actual endianness) - */ - ip->x[3] = (hash & 0xff000000) >> 24; - ip->x[2] = (hash & 0x00ff0000) >> 16; - ip->x[1] = (hash & 0x0000ff00) >> 8; - ip->x[0] = hash & 0x000000ff; + /* store the hash value (making sure it ends up in network byte order) */ + ip->x[0] = (hash & 0xff000000) >> 24; + ip->x[1] = (hash & 0x00ff0000) >> 16; + ip->x[2] = (hash & 0x0000ff00) >> 8; + ip->x[3] = hash & 0x000000ff; } /* converts IPv4 address in the common dotted-quad notation to ipv4_t */ -- This is the pisa developer mailing list. Please also subscribe to the main pisa list at: //www.freelists.org/list/pisa