From 804138a08c1fd6a4a3c19ead91eeb8ef312c36a0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 10 Feb 2015 21:15:47 +0100 Subject: test-lldp: initialize structs when we define them --- src/libsystemd-network/test-lldp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/libsystemd-network/test-lldp.c b/src/libsystemd-network/test-lldp.c index 946f358e32..f81284e2a7 100644 --- a/src/libsystemd-network/test-lldp.c +++ b/src/libsystemd-network/test-lldp.c @@ -45,13 +45,13 @@ static struct ether_addr mac_addr = { static int lldp_build_tlv_packet(tlv_packet **ret) { _cleanup_tlv_packet_free_ tlv_packet *m = NULL; const uint8_t lldp_dst[] = LLDP_MULTICAST_ADDR; - struct ether_header ether; + struct ether_header ether = { + .ether_type = htons(ETHERTYPE_LLDP), + }; /* Append ethernet header */ - memset(ðer, 0, sizeof(ether)); memcpy(ðer.ether_dhost, lldp_dst, ETHER_ADDR_LEN); memcpy(ðer.ether_shost, &mac_addr, ETHER_ADDR_LEN); - ether.ether_type = htons(ETHERTYPE_LLDP); assert_se(tlv_packet_new(&m) >= 0); -- cgit v1.2.3-54-g00ecf