-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: ethernet: Set the ptype by the caller in send #83228
net: ethernet: Set the ptype by the caller in send #83228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks jukkar.
Maybe in a next step custom bit-flags like net_pkt_set_lldp
and similar could be removed.
@@ -270,6 +270,9 @@ static inline struct net_pkt *arp_prepare(struct net_if *iface, | |||
return NULL; | |||
} | |||
|
|||
net_pkt_set_ll_proto_type(pkt, NET_ETH_PTYPE_ARP); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ARP context, arp_gratuitous_send()
needs an update too.
Yes, absolutely. There needs to be a cleanup before this is ready for merge. This is currently a draft so people could try it without it getting merged accidentally. |
80dbfd8
to
ff75c8a
Compare
|
d6c0a85
to
772623d
Compare
@clamattia I will do a separate PR for cleaning up fields in net_pkt that are not needed any more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for adjusting. As long as it is possible to use ethernet_send
with some custom ptype
set, I am happy. I do not understand some of the remaining special handling in said function.
Instead of setting the upper protocol type in ethernet_send() by checking the protocol type bits, use the ptype that is already set by the caller. This allows new protocol types to be supported and makes the system extensible. Signed-off-by: Jukka Rissanen <[email protected]>
Use the 192.0.2/24 address space reserved for documentation. No functional changes by this commit. Signed-off-by: Jukka Rissanen <[email protected]>
772623d
to
a839d07
Compare
While testing things, I noticed some issues with this. For example ping does not work to the device. If I am not able to figure out the culprit soon, I will send a revert for this. |
The ARP issue I encountered is fixed by #84158 |
Instead of setting the upper protocol type in ethernet_send() by checking the protocol type bits, use the ptype that is already set by the caller. This allows new protocol types to be supported and makes the system extensible