Re: valgrind warning in libnetfilter_log.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hugo Mildenberger wrote:
> The warning  could not be suppressed by zeroing the message buffer in 
> nflog_setmode, but it could be suppressed by zeroing  struct 
> nfulnl_msg_config_mode params: 
> 
> excerpt from libnetfilter_log/linux_nfnetlink_log.h:
> struct nfulnl_msg_config_mode {
>         u_int32_t       copy_range;
>         u_int8_t        copy_mode;
>         u_int8_t        _pad;
> } __attribute__ ((packed));
> 
> Therefore, this warning is caused by "_pad" remaining uninitialised. 
> Referencing "_pad" explicitely would be  somewhat unpleasant. Using memset 
> would induce additional computation only to suppress a warning. Best solution 
> would be to extend .copy_mode from u_int8_t to u_int16_t and drop ._pad 
> completely. There are more issues like that in linux_nfnetlink_log.h. I 
> wonder why this approach was choosen to achieve 16-bit alignment: "_pad " 
> will be transmitted anyway.

AFAICS, we can run into backward compatibility issues if remove _pad by
extending copy_mode. Hugo, I'd appreciate a patch that uses memset so
that we get rid of this warning.

-- 
"Los honestos son inadaptados sociales" -- Les Luthiers
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux