-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Esp32] mdns filter to handle MDNS traffic for esp32 #27961
base: master
Are you sure you want to change the base?
Conversation
namespace mdns { | ||
namespace Minimal { |
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.
This is an odd namespace to put this in....
// Non-mDNS is not filtered | ||
VerifyOrReturnValue(pktInfo.DestPort == kMdnsPort, FilterOutcome::kAllowPacket); | ||
|
||
if (pktInfo.DestAddress.IsIPv4() && pktInfo.DestPort == kMdnsPort) |
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.
Why is this bothering about checking pktInfo.DestPort again?
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.
Added change which will drop all IPv4 Mdns packets and allow IPv6 Mdns packets
{ | ||
if (!mStopLogging) | ||
{ | ||
ChipLogError(Discovery, "Started dropping mDNS from storm."); |
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.
This case has nothing to do with "storm", This is going to log as soon as we get an ipv4 packet, then stop logging usefully....
|
||
protected: | ||
std::atomic_size_t mNumQueuedMdnsPackets = { 0 }; | ||
size_t mMaxQueuedPackets = 0; |
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.
size_t mMaxQueuedPackets = 0; | |
const size_t mMaxQueuedPackets = 0; |
so it's clear why a non-atomic thing is ok here.
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.
added this change
{ | ||
if (mStopLogging) | ||
{ | ||
mStopLogging = false; |
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.
If we are really worried about the before/after functions being called at the same time on different threads, this logic around mStopLogging is broken. By the time we get here we might have already gone back to a state where mNumQueuedMdnsPackets >= mMaxQueuedPackets, no?
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.
Added a change which would not break
examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp
Outdated
Show resolved
Hide resolved
5876126
to
c21db8d
Compare
@PSONALl Please ping me on Slack when you make the updates per above. |
c21db8d
to
8969858
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
PSONALl seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Testing