Skip to content

Commit 034ec24

Browse files
Cla Mattia Galliardkartben
authored andcommitted
net: core: document the return value of the l3-handler
Give a more detailed explanation of the expectations towards a handler registered with the NET_L3_REGISTER-facilities. Signed-off-by: Cla Mattia Galliard <[email protected]>
1 parent 586bec7 commit 034ec24

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

include/zephyr/net/net_core.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,14 @@ struct net_l3_register {
169169
const char * const name;
170170
/** What L2 layer this is for */
171171
const struct net_l2 * const l2;
172-
/** Handler function for the given protocol type */
172+
/** Handler function for the specified protocol type. If the handler
173+
* has taken ownership of the pkt, it must return NET_OK. If it wants to
174+
* continue processing at the next level (e.g. ipv4), it must return
175+
* NET_CONTINUE. If instead something is wrong with the packet (for
176+
* example, a multicast address that does not match the protocol type)
177+
* it must return NET_DROP so that the statistics can be updated
178+
* accordingly
179+
*/
173180
enum net_verdict (*handler)(struct net_if *iface,
174181
uint16_t ptype,
175182
struct net_pkt *pkt);

0 commit comments

Comments
 (0)