Jarno,

Am 15.01.2018 um 14:28 schrieb Jarno Huuskonen:
> I'll try to test later (might be couple of days).

Did you find time, yet?

> I'll get a compilation error on centos7:
> src/sample.c: In function ‘sample_conv_ipmask’:
> src/sample.c:1623:3: error: ‘for’ loop initial declarations are only allowed 
> in C99 mode
>    for (size_t i = 0; i < 16; i++)
>    ^
> src/sample.c:1623:3: note: use option -std=c99 or -std=gnu99 to compile your 
> code
> 
> So maybe move size_t i outside of loop or unroll loop, something like
> +               *(uint32_t*)&smp->data.u.ipv6.s6_addr[0] &= 
> *(uint32_t*)&arg_p[1].data.ipv6.s6_addr[0];
> +               *(uint32_t*)&smp->data.u.ipv6.s6_addr[4] &= 
> *(uint32_t*)&arg_p[1].data.ipv6.s6_addr[4];
> +               *(uint32_t*)&smp->data.u.ipv6.s6_addr[8] &= 
> *(uint32_t*)&arg_p[1].data.ipv6.s6_addr[8];
> +               *(uint32_t*)&smp->data.u.ipv6.s6_addr[12] &= 
> *(uint32_t*)&arg_p[1].data.ipv6.s6_addr[12];
> 

Thinking about this for some time: I am not sure whether casting a char
pointer to a uint32_t pointer is safe from a language lawyer perspective
in all cases. I certainly can update the patch when Willy tells me his
preference (just move the declaration up or perform the casting).

Best regards
Tim Düsterhus

Reply via email to