[PATCH v0 10/13] ipv4ll: Initialize socket variable

2013-11-12 Thread Daniel Wagner
From: Daniel Wagner daniel.wag...@bmw-carit.de All members of the socket variable should be initialized corretly. Reported by coverty. --- gdhcp/ipv4ll.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdhcp/ipv4ll.c b/gdhcp/ipv4ll.c index 033ef81..9bf52b0 100644 --- a/gdhcp/ipv4ll.c +++

Re: [PATCH v0 10/13] ipv4ll: Initialize socket variable

2013-11-12 Thread Tomasz Bursztyka
Hi Daniel, struct sockaddr_ll sock; + fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_ARP)); if (fd 0) return fd; + memset(sock, 0, sizeof(sock)); Or just struct sockaddr_ll sock = {}; so no need to call memset. Tomasz

Re: [PATCH v0 10/13] ipv4ll: Initialize socket variable

2013-11-12 Thread Daniel Wagner
Hi Tomasz, On 11/12/2013 02:16 PM, Tomasz Bursztyka wrote: struct sockaddr_ll sock; + fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_ARP)); if (fd 0) return fd; +memset(sock, 0, sizeof(sock)); Or just struct sockaddr_ll sock = {}; so no need to

Re: [PATCH v0 10/13] ipv4ll: Initialize socket variable

2013-11-12 Thread Tomasz Bursztyka
Hi Daniel, FWIW, in a couple of other functions memset is used. I do not really care, but would like to have a consistent style. What's the preference? We need Marcel's input on that ;) Tomasz ___ connman mailing list connman@connman.net

Re: [PATCH v0 10/13] ipv4ll: Initialize socket variable

2013-11-12 Thread Marcel Holtmann
Hi Tomasz, FWIW, in a couple of other functions memset is used. I do not really care, but would like to have a consistent style. What's the preference? We need Marcel's input on that ;) I prefer the memset() of the address structs before using them. Regards Marcel