mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
test-lldp: initialize structs when we define them
This commit is contained in:
parent
b762fbd128
commit
804138a08c
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user