Skip to content

Commit

Permalink
Merge pull request #288 from ivpn/task/ping-manager-crash-xcode-beta
Browse files Browse the repository at this point in the history
Ping manager crashes when running with Xcode 14.1 Beta
  • Loading branch information
jurajhilje authored Sep 27, 2022
2 parents 7bbb488 + 8ce577e commit 7e4def9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IVPNClient/Utilities/Pinger/PingManager/Ping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ class Ping : NSObject {

//process the data we read.
if bytesRead > 0 {
var hoststr = CChar()
var hoststr = [CChar](repeating: 0, count: Int(INET_ADDRSTRLEN))
// char hoststr[INET6_ADDRSTRLEN];
var sin : sockaddr_in = UnsafeMutableRawPointer(addrSockaddr).bindMemory(to: sockaddr_in.self, capacity: Int(addrLen)).pointee
inet_ntop(Int32(sin.sin_family), &(sin.sin_addr), &hoststr, socklen_t(INET6_ADDRSTRLEN))
// struct sockaddr_in *sin = (struct sockaddr_in *)&addr;
// inet_ntop(sin->sin_family, &(sin->sin_addr), hoststr, INET6_ADDRSTRLEN);
let host = String(utf8String: &hoststr)
let host = String(cString: hoststr)

if(host == hostAddressString) { // only make sense where received packet comes from expected source

Expand Down

0 comments on commit 7e4def9

Please sign in to comment.