Skip to content

Commit

Permalink
fruity: Enable lwIP TCP timestamps and SACK
Browse files Browse the repository at this point in the history
To align with the Linux IP stack's defaults.
  • Loading branch information
oleavr committed Dec 8, 2024
1 parent 534d860 commit 2025b7a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/fruity/network-stack.vala
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ namespace Frida.Fruity {
if (self != null)
self->on_error (err);
});
pcb.set_flags (TIMESTAMP | SACK);
pcb.nagle_disable ();
pcb.bind_netif (&netstack.handle);

Expand Down
20 changes: 20 additions & 0 deletions vapi/lwip.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ namespace LWIP {
[CCode (cname = "tcp_err")]
public void set_error_callback (ErrorFunc f);

public void set_flags (Flags flags);

public void nagle_disable ();
public void nagle_enable ();

Expand Down Expand Up @@ -221,6 +223,24 @@ namespace LWIP {
[CCode (cname = "tcp_connected_fn", has_target = false)]
public delegate ErrorCode ConnectedFunc (void * user_data, TcpPcb pcb, ErrorCode err);

[Flags]
[CCode (cname = "tcpflags_t", cprefix = "TF_", has_type_id = false)]
public enum Flags {
ACK_DELAY,
ACK_NOW,
INFR,
CLOSEPEND,
RXCLOSED,
FIN,
NODELAY,
NAGLEMEMERR,
WND_SCALE,
BACKLOGPEND,
TIMESTAMP,
RTO,
SACK,
}

[Flags]
[CCode (cname = "u8_t", cprefix = "TCP_WRITE_FLAG_", has_type_id = false)]
public enum WriteFlags {
Expand Down

0 comments on commit 2025b7a

Please sign in to comment.