-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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: Align handling of different ethernet protocols in recv #83967
net: ethernet: Align handling of different ethernet protocols in recv #83967
Conversation
Remove unused family variable from receive function in ethernet layer 2. It is checked only once under such conditions, that do not allow the variable to be different. Signed-off-by: Cla Mattia Galliard <[email protected]>
0506b12
to
dfad2e3
Compare
subsys/net/l2/ethernet/ethernet.c
Outdated
!net_eth_is_addr_multicast((struct net_eth_addr *)lladdr->addr) && | ||
!net_eth_is_addr_lldp_multicast( | ||
(struct net_eth_addr *)lladdr->addr) && | ||
!net_eth_is_addr_ptp_multicast((struct net_eth_addr *)lladdr->addr) && |
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.
I am wondering how the group address check replaces the individual address checks. As this PR looks to be more related to refactoring the code, then this change looks to be doing a bit more than that.
Perhaps we should change this code in future PR where the actual ptype functionality is changed to be extensible.
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.
Fully agree, will revert.
This is needed, as soon as we have made ethernet
more extensible. We will either have to provide extentions points for this filter also. Or, what I want to propose, only filter out all non-broadcast-, non-multicast- (in the wider sense), non-unicast- (for us) frames.
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.
reverted
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.
I have handled this address checking issue in #84037
dfad2e3
to
8eb1186
Compare
Distribute packets to all ethernet protocols in a unified way. Signed-off-by: Cla Mattia Galliard <[email protected]>
8eb1186
to
4ecfdb0
Compare
Closing in favor of : #84037 |
Distribute packets to all ethernet protocols in a unified way. This would
also fix an issue, where lldp frames would get dropped too soon.
Refactor to handle
lldp
in a unified way witharp
,acd
andptp
.Depends on #83916
Note, that the behavior is slightly different for
lldp
as theethernet header
is stripped. But thesrc
anddst
are now available fromnet_pkt_lladdr_src(pkt)->addr
, I believe. This needs to be checked, if correct. Let me know, if you know more.