diff options
Diffstat (limited to 'src/Network/Tox/NodeId.hs')
-rw-r--r-- | src/Network/Tox/NodeId.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Network/Tox/NodeId.hs b/src/Network/Tox/NodeId.hs index 959d689c..d0c57416 100644 --- a/src/Network/Tox/NodeId.hs +++ b/src/Network/Tox/NodeId.hs | |||
@@ -223,7 +223,10 @@ instance Sized NodeInfo where | |||
223 | instance S.Serialize NodeInfo where | 223 | instance S.Serialize NodeInfo where |
224 | get = do | 224 | get = do |
225 | addrfam <- S.get :: S.Get Word8 | 225 | addrfam <- S.get :: S.Get Word8 |
226 | ip <- getIP addrfam | 226 | let fallback = do -- FIXME: Handle unrecognized address families. |
227 | IPv6 <$> S.get | ||
228 | return $ IPv6 (read "::" :: IPv6) | ||
229 | ip <- getIP addrfam <|> fallback | ||
227 | port <- S.get :: S.Get PortNumber | 230 | port <- S.get :: S.Get PortNumber |
228 | nid <- S.get | 231 | nid <- S.get |
229 | return $ NodeInfo nid ip port | 232 | return $ NodeInfo nid ip port |