-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Description
Or "UdpRecvData::addresses_ becomes empty after createSession in StickySessionUdpProxyFilter::onDataInternal"
Description:
envoy/source/extensions/filters/udp/udp_proxy/udp_proxy_filter.cc
Lines 84 to 90 in 8b38e06
Network::FilterStatus StickySessionUdpProxyFilter::onDataInternal(Network::UdpRecvData& data) { | |
bool defer_socket = config_->hasSessionFilters() || config_->tunnelingConfig(); | |
const auto active_session_it = sessions_.find(data.addresses_); | |
ActiveSession* active_session; | |
if (active_session_it == sessions_.end()) { | |
active_session = createSession(std::move(data.addresses_), nullptr, defer_socket); | |
if (active_session == nullptr) { |
In this function, data.addresses_ is moved after a new session gets created. This causes data.addresses_ to be empty and because of it, UDP session filters won't be able to access them.
This only affects the first packet received from the peer.
Repro steps:
Create or re-use an existing UDP session filter that implements onData and log the pointers of data.addresses_.peer_ and data.addresses_.local_
Logs:
