diff options
author | joe <joe@jerkface.net> | 2017-11-02 21:24:34 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-11-02 21:24:34 -0400 |
commit | b514e562e0d77b9adb8ca5c75289204013de2968 (patch) | |
tree | 07c3ec90614f9a51bf822f2d6bca1c11da2e5f56 /src/Network | |
parent | 30748b9edd4eb8df8998e29f68dfedb218ff8e8c (diff) |
Fixed onion routes for IPv4-mapped IPv6 addresses.
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/Tox.hs | 2 | ||||
-rw-r--r-- | src/Network/Tox/Onion/Transport.hs | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs index 0400f14a..6f591917 100644 --- a/src/Network/Tox.hs +++ b/src/Network/Tox.hs | |||
@@ -301,7 +301,7 @@ newTox keydb addr mbSessionsState = do | |||
301 | dhtclient <- newClient drg dhtnet0 DHT.classify (myAddr routing) (DHT.handlers crypto routing) id | 301 | dhtclient <- newClient drg dhtnet0 DHT.classify (myAddr routing) (DHT.handlers crypto routing) id |
302 | $ \client net -> onInbound (DHT.updateRouting client routing orouter) net | 302 | $ \client net -> onInbound (DHT.updateRouting client routing orouter) net |
303 | 303 | ||
304 | orouter <- forkRouteBuilder orouter $ \nid ni -> maybe [] (\(_,ns,_)->ns) <$> DHT.getNodes dhtclient nid ni | 304 | orouter <- forkRouteBuilder orouter $ \nid ni -> fmap (\(_,ns,_)->ns) <$> DHT.getNodes dhtclient nid ni |
305 | 305 | ||
306 | toks <- do | 306 | toks <- do |
307 | nil <- nullSessionTokens | 307 | nil <- nullSessionTokens |
diff --git a/src/Network/Tox/Onion/Transport.hs b/src/Network/Tox/Onion/Transport.hs index baadbbe8..39ea8c46 100644 --- a/src/Network/Tox/Onion/Transport.hs +++ b/src/Network/Tox/Onion/Transport.hs | |||
@@ -246,9 +246,10 @@ encodeOnionAddr getRoute (msg,OnionDestination _ ni (Just rid)) = do | |||
246 | return ( runPut $ putRequest $ wrapForRoute msg ni route | 246 | return ( runPut $ putRequest $ wrapForRoute msg ni route |
247 | , nodeAddr $ routeNodeA route) | 247 | , nodeAddr $ routeNodeA route) |
248 | mapM' f x = do | 248 | mapM' f x = do |
249 | let _ = x :: Maybe OnionRoute | ||
249 | hPutStrLn stderr $ "ONION encode sending to " ++ show ni | 250 | hPutStrLn stderr $ "ONION encode sending to " ++ show ni |
250 | hPutStrLn stderr $ "ONION encode getRoute -> " ++ show (mapM (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) | 251 | hPutStrLn stderr $ "ONION encode getRoute -> " ++ show (fmap (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) |
251 | mapM f x | 252 | mapM f x -- ONION encode getRoute -> Nothing |
252 | getRoute ni rid >>= mapM' go | 253 | getRoute ni rid >>= mapM' go |
253 | 254 | ||
254 | 255 | ||