]> git.michaelhowe.org Git - packages/o/openafs.git/commit
cellconfig: Do not use 'long' for dbserver IPs
authorAndrew Deason <adeason@sinenomine.net>
Tue, 10 Dec 2013 23:02:34 +0000 (17:02 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 25 Feb 2014 17:09:58 +0000 (09:09 -0800)
commit618343f0261bb5ffa036d93f1a3bc313ed76a037
treedb4b1e00ed656b4ac0209cd203a33998814ba512
parent3166cba243e6e69f52fedfe81ea4d407eb6553e1
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.

Reviewed-on: http://gerrit.openafs.org/10599
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d8f75d3206eaa56b3a819a5bc13a4bf3a9130512)

Change-Id: I2568577b05f47ebc75b34a9cd106fceac8a31ef7
Reviewed-on: http://gerrit.openafs.org/10603
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/auth/cellconfig.c