From ff56a95cb87e8ff91bf8585753948f25458f6a9d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 9 Jun 2018 20:33:48 +0200 Subject: Extract 2 bytes for port, not 4, in bootstrap connection receive --- src/BootstrapConnection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); - u16 port = deserializer.extract(); + u16 port = deserializer.extract(); 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; + } } } -- cgit v1.2.3