Re: udp checksum problems with dhcpcd v8.1.0
Giorgio Dal Molin
Tue Oct 15 15:12:36 2019
> On October 15, 2019 at 4:49 PM Roy Marples <roy@xxxxxxxxxxxx> wrote:
>
>
> On 15/10/2019 15:35, Giorgio Dal Molin wrote:
> > a quick test says no! the current master is still broken, v8.0.6 works.
> >
> > I'll put a couple of debug printf's in the code and find exactly where it
> > fails.
>
> Could you say which compiler you're using?
> I am unable to reproduce on gcc-8.3 or clang-7.0.1
>
> Roy
>
Hi,
I'm seeing strange things related to the compiler.
If I compile the current git master (29263035f3326a46d7baf86f63200b8118f425d1) with
gcc 9.2.0 I get the checksum failures, compiling the same code with clang 9 it works.
Trying to debug the gcc build I added a printf() as follows:
/* Lengths have already been checked. */
static bool
checksums_valid(void *packet,
struct in_addr *from, unsigned int flags)
{
...
ip_hlen = (size_t)ip->ip_hl * 4;
if (in_cksum(ip, ip_hlen, NULL) != 0) {
printf("%s: trace 1\n",__func__);
return false;
}
...
and so also the gcc 9.2.0 build works !
To investigate further I should check the generated asm but I think this
goes too far.
For me you can close this issue.
giorgio
Archive administrator: postmaster@marples.name