summaryrefslogtreecommitdiffstats
path: root/sys/dev/snp
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2008-11-05 12:13:10 +0000
committerdes <des@FreeBSD.org>2008-11-05 12:13:10 +0000
commit5778d16d174f6435f30d006c16daef69309261d9 (patch)
tree0f6342e143fbe2c651337d7ddc312427153f1c4e /sys/dev/snp
parentf611c006572f1abd3c6c1a466815ff2769eef033 (diff)
downloadFreeBSD-src-5778d16d174f6435f30d006c16daef69309261d9.zip
FreeBSD-src-5778d16d174f6435f30d006c16daef69309261d9.tar.gz
Like many other functions that handle sockaddrs, realhostname_sa() takes a
struct sockaddr * that it casts internally to the appropriate type based on sa_family. However, struct sockaddr has very lax alignment requirements, which causes the compiler to complain when you cast a struct sockaddr * to, say, a struct sockaddr_in6 *. I find it reasonable to assume that the pointer we received is in fact correctly aligned. Therefore, we can work around the compiler warnings by casting to void * before casting to the desired type. For readability's sake, this is done with macros. The same technique should prove useful in other parts of the tree that deal with socket addresses. MFC after: 3 weeks
Diffstat (limited to 'sys/dev/snp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud