1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Added L3 packet receive exception on BSD.

This commit is contained in:
Matias Fontanini
2014-10-25 17:42:46 -05:00
parent c4609fedd6
commit d55a03ca0c

View File

@@ -293,6 +293,9 @@ PDU *PacketSender::recv_l3(PDU &pdu, struct sockaddr* link_addr, uint32_t len_ad
open_l3_socket(type);
std::vector<int> sockets(1, _sockets[type]);
if(type == IP_TCP_SOCKET || type == IP_UDP_SOCKET) {
#ifdef BSD
throw std::runtime_error("Receiving L3 packets not supported on this platform");
#endif
open_l3_socket(ICMP_SOCKET);
sockets.push_back(_sockets[ICMP_SOCKET]);
}