net: Use packed structures for networking
authorDenis Pynkin <denis.pynkin@collabora.com>
Fri, 21 Jul 2017 16:28:42 +0000 (19:28 +0300)
committerAbel Vesa <abel.vesa@nxp.com>
Thu, 15 Feb 2018 14:42:50 +0000 (16:42 +0200)
commit6471b146daec52995fb7fe4d6e3a6f3464f53d89
treee5b0d6b1131e534d7e9241e8f15172b2897a6909
parent4eeeb82ec0d4c91a5061ed8955956873135502f7
net: Use packed structures for networking

PXE boot is broken with GCC 7.1 due option '-fstore-merging' enabled
by default for '-O2':

BOOTP broadcast 1
data abort
pc : [<8ff8bb30>]          lr : [<00004f1f>]
reloc pc : [<17832b30>]    lr : [<878abf1f>]
sp : 8f558bc0  ip : 00000000     fp : 8ffef5a4
r10: 8ffed248  r9 : 8f558ee0     r8 : 8ffef594
r7 : 0000000e  r6 : 8ffed700     r5 : 00000000  r4 : 8ffed74e
r3 : 00060101  r2 : 8ffed230     r1 : 8ffed706  r0 : 00000ddd
Flags: nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

Core reason is usage of structures for network headers without packed
attribute.

Cherry-picked from upstream commit: 704f3acfcf553 ("net: Use packed structures
for networking")

Reviewed-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
include/net.h
net/bootp.h
net/dns.h
net/nfs.h
net/sntp.h