diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-04-19 00:38:29 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-04-19 00:38:29 -0400 |
commit | c5910fd179d374f644ab3c843b243a51a7df9b24 (patch) | |
tree | 9623da2ab0411f3862d415a17be7be567688b714 /Assistant/Pairing | |
parent | bf1bf600fc94f6b95d5723473b148b35ab32073d (diff) |
removed all uses of undefined from code base
It's a code smell, can lead to hard to diagnose error messages.
Diffstat (limited to 'Assistant/Pairing')
-rw-r--r-- | Assistant/Pairing/Network.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Assistant/Pairing/Network.hs b/Assistant/Pairing/Network.hs index 7a4ac3ffe..694dcbbcc 100644 --- a/Assistant/Pairing/Network.hs +++ b/Assistant/Pairing/Network.hs @@ -33,9 +33,9 @@ pairingPort = 55556 {- Goal: Reach all hosts on the same network segment. - Method: Use same address that avahi uses. Other broadcast addresses seem - to not be let through some routers. -} -multicastAddress :: SomeAddr -> HostName -multicastAddress (IPv4Addr _) = "224.0.0.251" -multicastAddress (IPv6Addr _) = "ff02::fb" +multicastAddress :: AddrClass -> HostName +multicastAddress IPv4AddrClass = "224.0.0.251" +multicastAddress IPv6AddrClass = "ff02::fb" {- Multicasts a message repeatedly on all interfaces, with a 2 second - delay between each transmission. The message is repeated forever @@ -62,7 +62,7 @@ multicastPairMsg repeats secret pairdata stage = go M.empty repeats sendinterface cache i = void $ tryIO $ withSocketsDo $ bracket setup cleanup use where - setup = multicastSender (multicastAddress i) pairingPort + setup = multicastSender (multicastAddress IPv4AddrClass) pairingPort cleanup (sock, _) = sClose sock -- FIXME does not work use (sock, addr) = do setInterface sock (showAddr i) |