diff --git a/subsys/net/l2/ethernet/ethernet.c b/subsys/net/l2/ethernet/ethernet.c index 43d62478b90..fa6dea91145 100644 --- a/subsys/net/l2/ethernet/ethernet.c +++ b/subsys/net/l2/ethernet/ethernet.c @@ -523,6 +523,8 @@ static int ethernet_send(struct net_if *iface, struct net_pkt *pkt) ptype = htons(NET_ETH_PTYPE_IPV6); } else if (IS_ENABLED(CONFIG_NET_GPTP) && net_pkt_is_gptp(pkt)) { ptype = htons(NET_ETH_PTYPE_PTP); + } else if (IS_ENABLED(CONFIG_NET_LLDP) && net_pkt_is_lldp(pkt)) { + ptype = htons(NET_ETH_PTYPE_LLDP); } else if (IS_ENABLED(CONFIG_NET_ARP)) { /* Unktown type: Unqueued pkt is an ARP reply. */ diff --git a/subsys/net/l2/ethernet/lldp/lldp.c b/subsys/net/l2/ethernet/lldp/lldp.c index a30f38faae2..162a98132dc 100644 --- a/subsys/net/l2/ethernet/lldp/lldp.c +++ b/subsys/net/l2/ethernet/lldp/lldp.c @@ -88,7 +88,6 @@ static int lldp_send(struct ethernet_lldp *lldp) { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x0e } }; int ret = 0; - struct net_eth_hdr *hdr; struct net_pkt *pkt; struct net_buf *frag; u16_t pos; @@ -129,9 +128,6 @@ static int lldp_send(struct ethernet_lldp *lldp) net_pkt_lladdr_dst(pkt)->addr = (u8_t *)lldp_multicast_eth_addr.addr; net_pkt_lladdr_dst(pkt)->len = sizeof(struct net_eth_addr); - hdr = NET_ETH_HDR(pkt); - hdr->type = htons(NET_ETH_PTYPE_LLDP); - net_pkt_set_iface(pkt, lldp->iface); if (net_if_send_data(lldp->iface, pkt) == NET_DROP) {