shill: Fix an alignment error reported by ubsan.
Fix an misaligned reference binding caught by turning on ubsan in
Chrome OS.
Fortunately, the error is in the unit test only.
Root cause is kIcmpEchoRequestOddLen is cast to struct icmphdr but
it doesn't match the alignment needed by struct icmphdr.
aosp/system/connectivity/shill/icmp_unittest.cc:213:3: runtime error:
reference binding to misaligned address 0x55f46f0c1ace for
type 'const struct icmphdr', which requires 4 byte alignment
* 0x55f46f0c1ace: note: pointer points here
* 00 00 4a ae 08 00 00 00 ac 51 00 00 00 00 01 00 00 00 00 00 00 00 4e 35 73 68 69 6c 6c 32 35 49
* ^
* #0 0x55f46d0357ff in shill::IcmpTest_ComputeIcmpChecksum_Test::TestBody()
shill-0.0.3/aosp/system/connectivity/shill/icmp_unittest.cc:213:3
BUG=chromium:878862
BUG=chromium:875971
Change-Id: Id15b7f169668b9978520a5fdcfa0df91d4c2d5c6
Reviewed-on: https://chromium-review.googlesource.com/1195583
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
1 file changed