Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: wangbaiping(wbpcode) <[email protected]>
  • Loading branch information
wangbaiping(wbpcode) committed Mar 1, 2025
1 parent a979e54 commit f39d4d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/common/listener_manager/listener_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ bool ListenerManagerImpl::hasListenerWithDuplicatedAddress(const ListenerList& l
if (listener.reusePort() && existing_listener->name() == listener.name()) {
// If reuse port is enabled, we can skip the check between different versions of the
// same listener as they can create their own sockets anyway.
// If reuse port is disabled, the duplicated addresses check is necessary to ensure
// there is no address conflict between this two versions.
// If reuse port is disabled, the duplicated addresses check is necessary to to avoid
// attempting to bind to the same address when creating new sockets for the listener.
continue;
}

Expand Down Expand Up @@ -1146,6 +1146,8 @@ absl::Status ListenerManagerImpl::setNewOrDrainingSocketFactory(const std::strin
fmt::format("error adding listener: '{}' has duplicate address '{}' as existing listener",
name, absl::StrJoin(listener.addresses(), ",", Network::AddressStrFormatter()));
ENVOY_LOG(warn, "{}", message);
ENVOY_LOG(warn, "To check if the listener has duplicated addresses with other listeners or "
"'enable_reuse_port' is set to 'false' for the listener");
return absl::InvalidArgumentError(message);
}

Expand Down

0 comments on commit f39d4d3

Please sign in to comment.