aboutsummaryrefslogtreecommitdiffstats
path: root/Sources/WireGuardKit/WireGuardAdapter.swift (follow)
Commit message (Collapse)AuthorAgeFilesLines
* App: bump copyrightJason A. Donenfeld2023-02-151-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Global: bump copyright yearJason A. Donenfeld2021-06-171-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Kit: add missing import for WireGuardKitCAndrej Mihajlov2021-06-171-0/+1
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* Kit: Adapter: use more reliable utun detection techniqueJason A. Donenfeld2021-06-161-3/+24
| | | | | | | | | | | | | | | Rather than hoping that the AF_SYSTEM fd is of type utun, and then calling "2" on it to get the name -- which could be defined as something else for a different AF_SYSTEM socket type -- instead simply query the AF_SYSTEM control socket ID with getpeername. This has one catch, which is that the ID is dynamically allocated, so we resolve it using the qualified name. Normally we'd make a new AF_SYSTEM socket for this, but since that's not allowed in the sandbox, we reuse the AF_SYSTEM socket that we're checking. At this point in the flow, we know that it's a proper AF_SYSTEM one, based on the first sockaddr member; we just don't know that it's a utun variety. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Kit: Adapter: iterate through all FDs to find UTUNJason A. Donenfeld2021-06-161-1/+8
| | | | | | | | | | | | This is a bit of a kludge, until I find something better. We simply iterate through all FDs, and call getsockopt on each one until we find the utun FD. This works, and completes rather quickly (fd is usually 6 or 7). Rather than maintain the old path for older kernels, just use this for all versions, to get more coverage. Other techniques involve undocumented APIs; this one has the advantage of using nothing undocumented. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* SPM: update exclude rulesAndrej Mihajlov2021-06-161-1/+1
| | | | | | Fixes missing excluded file warning in Xcode. api-ios.go was renamed to api-apple.go. Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* Kit: Go: bump to latest APIJason A. Donenfeld2021-03-091-10/+12
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Kit: Adapter: do not treat NE settings timeouts as fatalJason A. Donenfeld2020-12-171-4/+1
| | | | | | | | | | The general Network Extension framework is incredibly buggy, and a timeout when setting the network settings does not necessarily imply that the whole operation failed. Simply log the condition and move on. This restores the app's old behavior. Reported-by: Filipe Mendonça <cfilipem@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* WireGuardKitGo: update to latest wireguard-go tagJason A. Donenfeld2020-12-151-7/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* WireGuardKit: Let wireguard-go backend run in offline on macOSAndrej Mihajlov2020-12-111-3/+8
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* WireGuardKit: Conditionally turn on/off wireguard-goAndrej Mihajlov2020-12-111-82/+178
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* global: bump year in headerJason A. Donenfeld2020-12-041-1/+1
| | | | | | A bit overdue, but better late than never. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* WireGuardKit: Log XLAT resolution errorsAndrej Mihajlov2020-12-041-1/+5
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* WireGuadKit: Rename WireGuardAdapter.version -> .backendVersion & remove `var wireGuardVersion` with WireGuardKit.swiftAndrej Mihajlov2020-12-041-1/+1
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* WireGuardApp: integrate WireGuardKit sources directlyAndrej Mihajlov2020-12-031-0/+3
| | | | Signed-off-by: Andrej Mihajlov <and@mullvad.net>
* WireGuardKit: Rename WireGuardKitSwift -> WireGuardKitAndrej Mihajlov2020-12-031-0/+349
Signed-off-by: Andrej Mihajlov <and@mullvad.net>