cellconfig: Do not use 'long' for dbserver IPs
authorAndrew Deason <adeason@sinenomine.net>
Tue, 10 Dec 2013 23:02:34 +0000 (17:02 -0600)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 18 Dec 2013 22:43:58 +0000 (14:43 -0800)
commitd8f75d3206eaa56b3a819a5bc13a4bf3a9130512
treee6da035bf2768b2ede66070e886a0045f00765ba
parent76076708a921aae0635975d418dea4b06d2c1af6
cellconfig: Do not use 'long' for dbserver IPs

A few places in this file assume that our dbserver IP addresses are
"long"s. A long int can be 8 bytes on some platforms, but we know
these IP addresses are all 4-byte integers. In the rare instances
where we have the maximum number of dbservers, this can overwrite a
bit of extra memory. This can also result in a misaligned access on
platforms such as SPARC v9, since the elements of he->h_addr_list are
not guaranteed to be 8-byte aligned.

So instead, treat these as 4-byte integers. For copying out of
he->h_addr_list, also use a memcpy anyway to be safe, since we are not
guaranteed alignment.

Change-Id: I1afd6e49df32693f86392cb39ce8d7477422aa94
Reviewed-on: http://gerrit.openafs.org/10599
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/auth/cellconfig.c