Skip to content

Commit

Permalink
fix(udp): retry send on first EINVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Dec 12, 2024
1 parent fdc001e commit 7ed29ac
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions quinn-udp/src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,20 @@ fn send(

if e.raw_os_error() == Some(libc::EINVAL) {
// Some arguments to `sendmsg` are not supported.
// Switch to fallback mode.
state.set_sendmsg_einval();
if !state.sendmsg_einval() {
// Switch to fallback mode.
state.set_sendmsg_einval();
prepare_msg(
transmit,
&dst_addr,
&mut msg_hdr,
&mut iovec,
&mut cmsgs,
encode_src_ip,
state.sendmsg_einval(),
);
continue;
}
}

// - EMSGSIZE is expected for MTU probes. Future work might be able to avoid
Expand Down

0 comments on commit 7ed29ac

Please sign in to comment.