summaryrefslogtreecommitdiff
path: root/gdhcp/ipv4ll.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdhcp/ipv4ll.c')
-rw-r--r--gdhcp/ipv4ll.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdhcp/ipv4ll.c b/gdhcp/ipv4ll.c
index 033ef816..9bf52b0a 100644
--- a/gdhcp/ipv4ll.c
+++ b/gdhcp/ipv4ll.c
@@ -122,10 +122,13 @@ int ipv4ll_arp_socket(int ifindex)
{
int fd;
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));
+
sock.sll_family = AF_PACKET;
sock.sll_protocol = htons(ETH_P_ARP);
sock.sll_ifindex = ifindex;