All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Borkmann <dborkman@redhat.com>
To: Willem de Bruijn <willemb@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH net-next] net-timestamp: expand documentation
Date: Thu, 04 Sep 2014 14:56:04 +0200	[thread overview]
Message-ID: <54086164.6030603@redhat.com> (raw)
In-Reply-To: <1409534867-32710-1-git-send-email-willemb@google.com>

Hi Willem,

On 09/01/2014 03:27 AM, Willem de Bruijn wrote:
> Expand Documentation/networking/timestamping.txt with new
> interfaces and bytestream timestamping. Also minor
> cleanup of the other text.
>
> Import txtimestamp.c test of the new features.
>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
...
> +static int recv_errmsg(int fd)
> +{
> +	static char ctrl[1024 /* overprovision*/];
> +	static struct msghdr msg;
> +	struct iovec entry;
> +	static char *data;
> +	int ret = 0;
> +
> +	data = malloc(cfg_payload_len);
> +	if (!data)
> +		error(1, 0, "malloc");
> +
> +	memset(&msg, 0, sizeof(msg));
> +	memset(&entry, 0, sizeof(entry));
> +	memset(ctrl, 0, sizeof(ctrl));
> +	memset(data, 0, sizeof(data));

I think this memset is wrong and should rather be
something like :

	memset(data, 0, cfg_payload_len);

> +	entry.iov_base = data;
> +	entry.iov_len = cfg_payload_len;
> +	msg.msg_iov = &entry;
> +	msg.msg_iovlen = 1;
> +	msg.msg_name = NULL;
> +	msg.msg_namelen = 0;
> +	msg.msg_control = ctrl;
> +	msg.msg_controllen = sizeof(ctrl);

  parent reply	other threads:[~2014-09-04 12:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  1:27 [PATCH net-next] net-timestamp: expand documentation Willem de Bruijn
2014-09-02  4:49 ` David Miller
2014-09-04 12:56 ` Daniel Borkmann [this message]
2014-09-04 14:03   ` Willem de Bruijn

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=54086164.6030603@redhat.com \
    --to=dborkman@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    /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.