aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-26 19:00:19 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-27 19:07:16 +0530
commit3aed009eb67702fd2eb6e0e987e464123386fbe3 (patch)
treef226fe933e2c41fc42b3f2f0abfe14a584757bf0 /WireGuard
parentVPN: DNSResolver: A class that does DNS resolution using getaddrinfo (diff)
downloadwireguard-apple-3aed009eb67702fd2eb6e0e987e464123386fbe3.tar.xz
wireguard-apple-3aed009eb67702fd2eb6e0e987e464123386fbe3.zip
Tunnel detail: Account for status section in peer index calculations
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
index f5a6936..c24828b 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelDetailTableViewController.swift
@@ -103,9 +103,9 @@ extension TunnelDetailTableViewController {
return interfaceData.filterFieldsWithValueOrControl(interfaceFields: interfaceFieldsBySection[section - 1]).count
} else if ((numberOfPeers > 0) && (section < (1 + numberOfInterfaceSections + numberOfPeers * numberOfPeerSections))) {
// Peer
- let peerIndex = Int((section - numberOfInterfaceSections) / numberOfPeerSections)
+ let peerIndex = Int((section - 1 - numberOfInterfaceSections) / numberOfPeerSections)
let peerData = tunnelViewModel.peersData[peerIndex]
- let peerSectionIndex = (section - numberOfInterfaceSections) % numberOfPeerSections
+ let peerSectionIndex = (section - 1 - numberOfInterfaceSections) % numberOfPeerSections
return peerData.filterFieldsWithValueOrControl(peerFields: peerFieldsBySection[peerSectionIndex]).count
} else {
// Delete tunnel