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 <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2017-09-29 14:09:02 +02:00
parent 0c4dbd481a
commit 2b9acc60c0
4 changed files with 14 additions and 0 deletions

View File

@ -129,6 +129,8 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt,
dest_sll.sll_family = AF_PACKET;
dest_sll.sll_protocol = htons(ETH_P_IP);
dest_sll.sll_ifindex = ifindex;
/*dest_sll.sll_hatype = ARPHRD_???;*/
/*dest_sll.sll_pkttype = PACKET_???;*/
dest_sll.sll_halen = 6;
memcpy(dest_sll.sll_addr, dest_arp, 6);