summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mainline.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Mainline.hs b/Mainline.hs
index ac870a43..5996b214 100644
--- a/Mainline.hs
+++ b/Mainline.hs
@@ -156,11 +156,12 @@ instance Read NodeInfo where
156 return (nid,addrstr) 156 return (nid,addrstr)
157 (nid,addrstr) <- ( nodeidAt RP.+++ ( (zeroID,) <$> parseAddr) ) 157 (nid,addrstr) <- ( nodeidAt RP.+++ ( (zeroID,) <$> parseAddr) )
158 let raddr = do 158 let raddr = do
159 -- TODO: Support IPv6 159 ip <- RP.between (RP.char '[') (RP.char ']')
160 ipv4 <- RP.readS_to_P (readsPrec i) 160 (IPv6 <$> RP.readS_to_P (readsPrec i))
161 RP.+++ (IPv4 <$> RP.readS_to_P (readsPrec i))
161 _ <- RP.char ':' 162 _ <- RP.char ':'
162 port <- toEnum <$> RP.readS_to_P (readsPrec i) 163 port <- toEnum <$> RP.readS_to_P (readsPrec i)
163 return (IPv4 ipv4, port) 164 return (ip, port)
164 165
165 (ip,port) <- case RP.readP_to_S raddr addrstr of 166 (ip,port) <- case RP.readP_to_S raddr addrstr of
166 [] -> fail "Bad address." 167 [] -> fail "Bad address."