Skip to content

Commit

Permalink
macos: add TCP_FASTOPEN_FORCE_ENABLE
Browse files Browse the repository at this point in the history
This is used to disable the backoff mechanism, otherwise TFO is basically unusable.

Updates rust-lang#1632 and rust-lang#1635

Definition: https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/netinet/tcp.h#L310

Related commits/PRs: zonyitoo/tokio-tfo#5, database64128/tfo-go@c980f6b
  • Loading branch information
database64128 committed Mar 3, 2023
1 parent 973c3e1 commit 08b2969
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,7 @@ TAB2
TAB3
TABDLY
TCP_FASTOPEN
TCP_FASTOPEN_FORCE_ENABLE
TCP_KEEPALIVE
TCP_KEEPCNT
TCP_KEEPINTVL
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3657,6 +3657,8 @@ pub const TCP_KEEPINTVL: ::c_int = 0x101;
pub const TCP_KEEPCNT: ::c_int = 0x102;
/// Enable/Disable TCP Fastopen on this socket
pub const TCP_FASTOPEN: ::c_int = 0x105;
/// Disable/Enable TCP Fastopen backoff mechanism.
pub const TCP_FASTOPEN_FORCE_ENABLE: ::c_int = 0x218;

pub const SOL_LOCAL: ::c_int = 0;

Expand Down

0 comments on commit 08b2969

Please sign in to comment.