Skip to content

Commit

Permalink
Revert "Enable DNSSD on ipv4 if broadcast is available"
Browse files Browse the repository at this point in the history
This reverts commit c4d3f6c.
  • Loading branch information
andy31415 committed Mar 18, 2022
1 parent 08d1bba commit 7d12029
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
12 changes: 1 addition & 11 deletions examples/minimal-mdns/AllInterfaceListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,14 @@ class AllInterfaces : public mdns::Minimal::ListenIterator
}
}

template <typename T>
inline bool MulticastOk(T & iterator)
{
return iterator.SupportsMulticast()
#if INET_CONFIG_ENABLE_IPV4
|| iterator.HasBroadcastAddress()
#endif
;
}

bool SkipCurrentInterface()
{
if (!mIterator.HasCurrent())
{
return false; // nothing to try.
}

if (!mIterator.IsUp() || !MulticastOk(mIterator))
if (!mIterator.IsUp() || !mIterator.SupportsMulticast())
{
return true; // not a usable interface
}
Expand Down
12 changes: 1 addition & 11 deletions src/lib/dnssd/AllInterfacesListenIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,12 @@
namespace chip {
namespace Dnssd {

template <typename T>
inline bool MulticastOk(T & iterator)
{
return iterator.SupportsMulticast()
#if INET_CONFIG_ENABLE_IPV4
|| iterator.HasBroadcastAddress()
#endif
;
}

/// Checks if the current interface is powered on
/// and not local loopback.
template <typename T>
bool IsCurrentInterfaceUsable(T & iterator)
{
if (!iterator.IsUp() || !MulticastOk(iterator))
if (!iterator.IsUp() || !iterator.SupportsMulticast())
{
return false; // not a usable interface
}
Expand Down
13 changes: 1 addition & 12 deletions src/lib/dnssd/MinimalMdnsServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,12 @@ namespace chip {
namespace Dnssd {

namespace Internal {

template <typename T>
inline bool MulticastOk(T & iterator)
{
return iterator.SupportsMulticast()
#if INET_CONFIG_ENABLE_IPV4
|| iterator.HasBroadcastAddress()
#endif
;
}

/// Checks if the current interface is powered on
/// and not local loopback.
template <typename T>
bool IsCurrentInterfaceUsable(T & iterator)
{
if (!iterator.IsUp() || !MulticastOk(iterator))
if (!iterator.IsUp() || !iterator.SupportsMulticast())
{
return false; // not a usable interface
}
Expand Down

0 comments on commit 7d12029

Please sign in to comment.