Fix incorrect hardware address on systems without getifaddrs()
authorCraig Scott <craig.scott@csiro.au>
Wed, 11 May 2011 06:51:28 +0000 (16:51 +1000)
committerMartin Petersson <martin.petersson@nokia.com>
Fri, 20 May 2011 08:46:47 +0000 (10:46 +0200)
commit0ebe0414d23c15cb21ebf212bb8b82d66b68c73b
treec16649a9c5f94b6e4f06ba53c9c9c082b84c6935
parent5a19d52ae7498ef331520c2878128079d3723032
Fix incorrect hardware address on systems without getifaddrs()

On unix systems for which QT_NO_GETIFADDRS is defined, the way that the
hardware address field is extracted from the result of a call to
qt_safe_ioctl() is incorrect. The address of the ifreq.ifr_addr struct
is taken rather than the appropriate member within that struct, sa_data,
resulting in a memory offset and subsequently the hardware address has
garbage in the first two of six fields. This commit modifies the code
to pass the sa_data member instead of the address of the struct as a
whole.

Task-number: QTBUG-19165
Merge-request: 2614
Reviewed-by: Martin Petersson
(cherry picked from commit 004ad12669ef696eeba70fd57d1eb0c67c806d1d)
src/network/kernel/qnetworkinterface_unix.cpp