net/lldp: Fix where Ethernet PTYPE is set for LLDP message

Since the rework of L2/L3 split, only L2 has access to its header. Thus
up to Ethernet one to set LLDP PTYPE.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2019-01-11 13:35:11 +01:00 committed by Jukka Rissanen
commit 9a41078c51
2 changed files with 2 additions and 4 deletions

View file

@ -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.
*/

View file

@ -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) {