diff options
author | joe <joe@jerkface.net> | 2017-01-21 05:39:18 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-01-21 05:39:18 -0500 |
commit | b70401c23869b02a2fa1229b78e40aa824d9fbe2 (patch) | |
tree | 7207055364adedc8e1910b0b8d773b4a2d56e177 /src/Network | |
parent | 19424fb17ff90dcfa0e9a6c871eddbc7472ff8ef (diff) |
getBindAddress falls back to ipv4.
Diffstat (limited to 'src/Network')
-rw-r--r-- | src/Network/BitTorrent/Address.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/Address.hs b/src/Network/BitTorrent/Address.hs index ed02f7ff..b4ce96b0 100644 --- a/src/Network/BitTorrent/Address.hs +++ b/src/Network/BitTorrent/Address.hs | |||
@@ -1281,6 +1281,8 @@ getBindAddress listenPortString enabled6 = do | |||
1281 | listenAddr = | 1281 | listenAddr = |
1282 | case if enabled6 then x6s++x4s else x4s of | 1282 | case if enabled6 then x6s++x4s else x4s of |
1283 | AddrInfo { addrAddress = listenAddr } : _ -> listenAddr | 1283 | AddrInfo { addrAddress = listenAddr } : _ -> listenAddr |
1284 | _ -> SockAddrInet6 (parsePort listenPortString) 0 iN6ADDR_ANY 0 | 1284 | _ -> if enabled6 |
1285 | then SockAddrInet6 (parsePort listenPortString) 0 iN6ADDR_ANY 0 | ||
1286 | else SockAddrInet (parsePort listenPortString) iNADDR_ANY | ||
1285 | where parsePort s = fromMaybe 0 $ readMaybe s | 1287 | where parsePort s = fromMaybe 0 $ readMaybe s |
1286 | return listenAddr | 1288 | return listenAddr |