Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Respect link MTU in TCP
Browse files Browse the repository at this point in the history
Mitigates #39
  • Loading branch information
keeshux committed Oct 21, 2018
1 parent 26fc12c commit f93634b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TunnelKit/Sources/AppExtension/Transport/NETCPInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class NETCPSocket: NSObject, GenericSocket {
}

func link(withMTU mtu: Int) -> LinkInterface {
return NETCPLink(impl: impl)
return NETCPLink(impl: impl, mtu: mtu)
}

// MARK: Connection KVO (any queue)
Expand Down Expand Up @@ -181,9 +181,9 @@ class NETCPLink: LinkInterface {

private let maxPacketSize: Int

init(impl: NWTCPConnection, maxPacketSize: Int? = nil) {
init(impl: NWTCPConnection, mtu: Int, maxPacketSize: Int? = nil) {
self.impl = impl
self.mtu = .max
self.mtu = mtu
self.maxPacketSize = maxPacketSize ?? (512 * 1024)
}

Expand Down

0 comments on commit f93634b

Please sign in to comment.