Skip to content

listener: replacing a listener with same port but TCP -> UDP crashes #15562

Closed

Description

@mattklein123

The following code needs to take into account TCP vs. UDP otherwise we end up trying to create a new TCP listener for a UDP configuration.

auto existing_draining_listener = std::find_if(
draining_listeners_.cbegin(), draining_listeners_.cend(),
[&new_listener](const DrainingListener& listener) {
return listener.listener_->listenSocketFactory().sharedSocket().has_value() &&
listener.listener_->listenSocketFactory().sharedSocket()->get().isOpen() &&
*new_listener->address() ==
*listener.listener_->listenSocketFactory().localAddress();
});

Activity

  1. self-assigned this
    on Mar 19, 2021
  2. mattklein123 commented on Mar 19, 2021

    @mattklein123
    MemberAuthor

    This is a follow on from the issue reported here: #12043 (comment) by @zarianec.

    cc @lambdai FYI

  3. lambdai commented on Mar 22, 2021

    @lambdai
    Contributor

    I see... I guess we can reject new listener config if tcp listener and udp listener cannot use the same port.
    Or find listener by both L4 address and L4 protocol

  4. mattklein123 commented on Mar 22, 2021

    @mattklein123
    MemberAuthor

    Or find listener by both L4 address and L4 protocol

    Yeah I think ^. IMO it's fine to have different protocols on the same port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions