File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
subsys/net/l2/ethernet/lldp Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,6 @@ struct net_lldpdu {
141141 struct net_lldp_chassis_tlv chassis_id ; /* Mandatory TLV */
142142 struct net_lldp_port_tlv port_id ; /* Mandatory TLV */
143143 struct net_lldp_time_to_live_tlv ttl ; /* Mandatory TLV */
144-
145- #if defined(CONFIG_NET_LLDP_END_LLDPDU_TLV_ENABLED )
146- /** Optional End of LLDPDU TLV. Must be set to 0x0000 always. */
147- const uint16_t end_lldpdu_tlv ;
148- #endif /* CONFIG_NET_LLDP_END_LLDPDU_TLV_ENABLED */
149144} __packed ;
150145
151146/**
Original file line number Diff line number Diff line change @@ -127,6 +127,17 @@ static int lldp_send(struct ethernet_lldp *lldp)
127127 }
128128 }
129129
130+ if (IS_ENABLED (CONFIG_NET_LLDP_END_LLDPDU_TLV_ENABLED )) {
131+ u16_t tlv_end = htons (NET_LLDP_END_LLDPDU_VALUE );
132+
133+ if (!net_pkt_write_new (pkt , (u8_t * )& tlv_end ,
134+ sizeof (tlv_end ))) {
135+ net_pkt_unref (pkt );
136+ ret = - ENOMEM ;
137+ goto out ;
138+ }
139+ }
140+
130141 net_pkt_lladdr_src (pkt )-> addr = net_if_get_link_addr (lldp -> iface )-> addr ;
131142 net_pkt_lladdr_src (pkt )-> len = sizeof (struct net_eth_addr );
132143 net_pkt_lladdr_dst (pkt )-> addr = (u8_t * )lldp_multicast_eth_addr .addr ;
You can’t perform that action at this time.
0 commit comments