All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Hugo Mildenberger <Hugo.Mildenberger@t-online.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: valgrind warning in libnetfilter_log.c
Date: Tue, 25 Mar 2008 11:24:28 +0100	[thread overview]
Message-ID: <47E8D2DC.9090108@netfilter.org> (raw)
In-Reply-To: <200803241447.41041.Hugo.Mildenberger@t-online.de>

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

      reply	other threads:[~2008-03-25 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 13:47 valgrind warning in libnetfilter_log.c Hugo Mildenberger
2008-03-25 10:24 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E8D2DC.9090108@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=Hugo.Mildenberger@t-online.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.