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
+++
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
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
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
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