[U-Boot] [PATCH v2 1/1] net: avoid address-of-packed-member error
Joe Hershberger
joe.hershberger at ni.com
Thu Dec 5 18:57:18 CET 2019
On Thu, Dec 5, 2019 at 1:19 AM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On 11/6/19 12:07 AM, Joe Hershberger wrote:
> > On Tue, Nov 5, 2019 at 5:49 AM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
> >>
> >> sandbox_defconfig does not compile using GCC 9.2.1:
> >>
> >> net/net.c: In function ‘net_process_received_packet’:
> >> net/net.c:1288:23: error: taking address of packed member of ‘struct
> >> ip_udp_hdr’ may result in an unaligned pointer value
> >> [-Werror=address-of-packed-member]
> >> 1288 | sumptr = (ushort *)&(ip->udp_src);
> >> | ^~~~~~~~~~~~~~
> >>
> >> Avoid the error by using a u8 pointer instead of an u16 pointer and
> >> in-lining ntohs().
> >
> > Seems reasonable.
> >
> >> Simplify the checksumming of the last message byte.
> >>
> >> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> >
> > Acked-by: Joe Hershberger <joe.hershberger at ni.com>
> >
>
> Hello Joe,
>
> this patch did not yet make it into
> https://gitlab.denx.de/u-boot/custodians/u-boot-net/commits/master
>
> Is there something that needs to be changed?
No, it is among the patches I'm currently testing [1].
[1] - https://github.com/jhershbe/u-boot/commits/travis_ci/test_1184510
Cheers,
-Joe
More information about the U-Boot
mailing list