[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54086164.6030603@redhat.com>
Date: Thu, 04 Sep 2014 14:56:04 +0200
From: Daniel Borkmann <dborkman@...hat.com>
To: Willem de Bruijn <willemb@...gle.com>
CC: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH net-next] net-timestamp: expand documentation
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@...gle.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);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists