diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-06-09 20:33:48 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 22:56:48 +0200 |
commit | ff56a95cb87e8ff91bf8585753948f25458f6a9d (patch) | |
tree | f5ce363510a6fd9ea3d2538d5c0e3f01cd7e87bb | |
parent | fdbbf63f42c8bee7a5afc43e96271d573487dd76 (diff) |
Extract 2 bytes for port, not 4, in bootstrap connection receive
-rw-r--r-- | src/BootstrapConnection.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/BootstrapConnection.cpp b/src/BootstrapConnection.cpp index ccd2141..4691462 100644 --- a/src/BootstrapConnection.cpp +++ b/src/BootstrapConnection.cpp @@ -55,7 +55,7 @@ namespace sibs if(addressFamily == AF_INET) { in_addr_t ipv4Address = deserializer.extract<u32>(); - u16 port = deserializer.extract<u32>(); + u16 port = deserializer.extract<u16>(); Ipv4 newPeerAddress; newPeerAddress.address.sin_family = addressFamily; newPeerAddress.address.sin_addr.s_addr = ipv4Address; @@ -74,7 +74,10 @@ namespace sibs }, std::bind(&BootstrapConnection::receiveDataFromPeer, this, listenerCallbackFunc, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); } else + { Log::error("BootstrapConnection: Unknown address family: %d", addressFamily); + return; + } } } |