send reset instead of silently dropping packets due to misrouting
Summary:
There were some TODOs left in the QuicServerWorker where we silently drop
packets.
MODIFY
quic/server/QuicServerWorker.cpp
quic/server/QuicServerWorker.cpp
@@ -414,11 +414,13 @@ void QuicServerWorker::forwardNetworkData(
"Dropping packet due to unknown connectionId version, routingInfo={}",
logRoutingInfo(routingData.destinationConnId));
QUIC_STATS(
- statsCallback_,
- onPacketDropped,
- PacketDropReason::CONNECTION_NOT_FOUND);
+ statsCallback_, onPacketDropped, PacketDropReason::PARSE_ERROR);
+ return sendResetPacket(
+ routingData.headerForm,
+ client,
+ networkData,
+ routingData.destinationConnId);
}
- return;
}
bool userSpacePktRoute;
@@ -438,7 +440,11 @@ void QuicServerWorker::forwardNetworkData(
logRoutingInfo(routingData.destinationConnId));
QUIC_STATS(
statsCallback_, onPacketDropped, PacketDropReason::PARSE_ERROR);
- return;
+ return sendResetPacket(
+ routingData.headerForm,
+ client,
+ networkData,
+ routingData.destinationConnId);
}
if (LIKELY(connIdParam->workerId == workerId_)) {
userSpacePktRoute = false;
@@ -601,14 +607,20 @@ void QuicServerWorker::dispatchPacketData(
statsCallback_,
onPacketDropped,
PacketDropReason::CANNOT_MAKE_TRANSPORT);
+ // TODO reevaluate sending stateless reset here. At this state, the peer
+ // will not have received the token yet. So these reset packets will just
+ // be dropped by the peer.
return;
}
if (!connIdAlgo_->canParse(routingData.destinationConnId)) {
VLOG(3) << "Dropping packet with bad DCID, routingInfo="
<< logRoutingInfo(routingData.destinationConnId);
QUIC_STATS(statsCallback_, onPacketDropped, PacketDropReason::PARSE_ERROR);
- // TODO do we need to reset?
- return;
+ return sendResetPacket(
+ routingData.headerForm,
+ client,
+ networkData,
+ routingData.destinationConnId);
}
auto connIdParam =
connIdAlgo_->parseConnectionId(routingData.destinationConnId);
@@ -619,8 +631,11 @@ void QuicServerWorker::dispatchPacketData(
folly::to<std::string>(connIdParam.error().errorCode()),
logRoutingInfo(routingData.destinationConnId));
QUIC_STATS(statsCallback_, onPacketDropped, PacketDropReason::PARSE_ERROR);
- // TODO do we need to reset?
- return;
+ return sendResetPacket(
+ routingData.headerForm,
+ client,
+ networkData,
+ routingData.destinationConnId);
}
if (connIdParam->hostId != hostId_) {
VLOG(3) << "Dropping packet routed to wrong host, routingInfo="

send reset instead of silently dropping packets due to misrouting

Summary:
There were some TODOs left in the QuicServerWorker where we silently drop
packets.

Reviewed By: mjoras, yangchi

Differential Revision: D21235150

fbshipit-source-id: eb546ea6d792915cf3155370758e837318530a38