Skip to content

Commit 0b94947

Browse files
Florian Grandelcarlescufi
authored andcommitted
net: l2: ieee802154: set ll protocol in pkt
The IEEE 802.15.4 L2 now sets the ll protocol in the packet to a specific value. This corresponds to the respective solution in Linux and is required to validate access to IEEE 802.15.4 specific attributes of the packet. Later change sets will rely on this value to ensure that IEEE 802.15.4 specific package content can only be accessed on IEEE 802.15.4 packages. Signed-off-by: Florian Grandel <[email protected]>
1 parent 389bd57 commit 0b94947

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/net/l2/ieee802154/ieee802154.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LOG_MODULE_REGISTER(net_ieee802154, CONFIG_NET_L2_IEEE802154_LOG_LEVEL);
1515
#include <errno.h>
1616

1717
#include <zephyr/net/capture.h>
18+
#include <zephyr/net/ethernet.h>
1819
#include <zephyr/net/net_core.h>
1920
#include <zephyr/net/net_if.h>
2021
#include <zephyr/net/net_l2.h>
@@ -237,6 +238,8 @@ static enum net_verdict ieee802154_recv(struct net_if *iface, struct net_pkt *pk
237238

238239
ieee802154_acknowledge(iface, &mpdu);
239240

241+
net_pkt_set_ll_proto_type(pkt, ETH_P_IEEE802154);
242+
240243
set_pkt_ll_addr(net_pkt_lladdr_src(pkt), mpdu.mhr.fs->fc.pan_id_comp,
241244
mpdu.mhr.fs->fc.src_addr_mode, mpdu.mhr.src_addr);
242245

0 commit comments

Comments
 (0)