From 2b9acc60c0468379cd24d13bc9e3f3e50761c0c9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 29 Sep 2017 14:09:02 +0200 Subject: udhcpc[6]: initialize entire sockaddr_ll I see random field values like sll_hatype=0x267 when I strace. They seem to not matter, but just in case they sometimes do, let's at least have deterministic values (via memset(0)). function old new delta change_listen_mode 308 322 +14 Signed-off-by: Denys Vlasenko --- networking/udhcp/d6_dhcpc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'networking/udhcp/d6_dhcpc.c') diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c index 714555fa8..d4bb3507b 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c @@ -881,9 +881,14 @@ static int d6_raw_socket(int ifindex) fd = xsocket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IPV6)); log2("got raw socket fd %d", fd); + memset(&sock, 0, sizeof(sock)); /* let's be deterministic */ sock.sll_family = AF_PACKET; sock.sll_protocol = htons(ETH_P_IPV6); sock.sll_ifindex = ifindex; + /*sock.sll_hatype = ARPHRD_???;*/ + /*sock.sll_pkttype = PACKET_???;*/ + /*sock.sll_halen = ???;*/ + /*sock.sll_addr[8] = ???;*/ xbind(fd, (struct sockaddr *) &sock, sizeof(sock)); #if 0 -- cgit v1.2.3