Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

DeviceManager: don't listen on 11095 when ephemeral is enabled #573

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/lib/core/WeaveMessageLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2000,7 +2000,11 @@ WEAVE_ERROR WeaveMessageLayer::RefreshEndpoints()
// messages to other nodes, and to receive their replies, unless the outbound ephemeral UDP port
// feature has been enabled.
//
#if WEAVE_CONFIG_ENABLE_EPHEMERAL_UDP_PORT
const bool listenIPv4UDP = (listenIPv4 && listenUDP && !EphemeralUDPPortEnabled());
#else
const bool listenIPv4UDP = (listenIPv4 && listenUDP);
#endif
err = RefreshEndpoint(mIPv4UDP, listenIPv4UDP,
"Weave IPv4 UDP", kIPAddressType_IPv4, listenIPv4Addr, WEAVE_PORT, INET_NULL_INTERFACEID);
SuccessOrExit(err);
Expand All @@ -2013,7 +2017,7 @@ WEAVE_ERROR WeaveMessageLayer::RefreshEndpoints()
// receive their replies. It is only enabled when the outbound ephemeral UDP port feature has been
// enabled.
//
const bool listenIPv4EphemeralUDP = (listenIPv4UDP && EphemeralUDPPortEnabled());
const bool listenIPv4EphemeralUDP = (listenIPv4 && listenUDP && EphemeralUDPPortEnabled());
err = RefreshEndpoint(mIPv4EphemeralUDP, listenIPv4EphemeralUDP,
"ephemeral IPv4 UDP", kIPAddressType_IPv4, listenIPv4Addr, 0, INET_NULL_INTERFACEID);
SuccessOrExit(err);
Expand All @@ -2029,7 +2033,11 @@ WEAVE_ERROR WeaveMessageLayer::RefreshEndpoints()
// messages to other nodes, and to receive their replies, unless the outbound ephemeral UDP port
// feature has been enabled.
//
#if WEAVE_CONFIG_ENABLE_EPHEMERAL_UDP_PORT
const bool listenIPv6UDP = (listenIPv6 && listenUDP && !EphemeralUDPPortEnabled());
#else
const bool listenIPv6UDP = (listenIPv6 && listenUDP);
#endif
err = RefreshEndpoint(mIPv6UDP, listenIPv6UDP,
"Weave IPv6 UDP", kIPAddressType_IPv6, listenIPv6Addr, WEAVE_PORT, listenIPv6Intf);
SuccessOrExit(err);
Expand All @@ -2042,7 +2050,7 @@ WEAVE_ERROR WeaveMessageLayer::RefreshEndpoints()
// receive their replies. It is only enabled when the outbound ephemeral UDP port feature has been
// enabled.
//
const bool listenIPv6EphemeralUDP = (listenIPv6UDP && EphemeralUDPPortEnabled());
const bool listenIPv6EphemeralUDP = (listenIPv6 && listenUDP && EphemeralUDPPortEnabled());
err = RefreshEndpoint(mIPv6EphemeralUDP, listenIPv6EphemeralUDP,
"ephemeral IPv6 UDP", kIPAddressType_IPv6, listenIPv6Addr, 0, listenIPv6Intf);
SuccessOrExit(err);
Expand Down