mirror of
https://github.com/mfontanini/libtins
synced 2026-01-25 11:41:35 +01:00
Fix -Wextra compiler warnings. (#184)
* Fix -Wextra compiler warnings. Fix #183. Signed-off-by: Kyle Fazzari <github@status.e4ward.com> * Comment out unused parameters. This is done everywhere possible instead of using Internals::unused(). Note that this involved moving some implementations into the corresponding .cpp file. Signed-off-by: Kyle Fazzari <github@status.e4ward.com> * Fix warnings in tests as well. Signed-off-by: Kyle Fazzari <github@status.e4ward.com> * Leave IPv4Reassembler alone, it's growing. Signed-off-by: Kyle Fazzari <github@status.e4ward.com>
This commit is contained in:
committed by
Matias Fontanini
parent
94e5ac2109
commit
a71a3d29ff
@@ -156,6 +156,7 @@ bool PacketSender::ether_socket_initialized(const NetworkInterface& iface) const
|
||||
#if defined(BSD) || defined(__FreeBSD_kernel__)
|
||||
return ether_socket_.count(iface.id());
|
||||
#else
|
||||
Internals::unused(iface);
|
||||
return ether_socket_ != INVALID_RAW_SOCKET;
|
||||
#endif
|
||||
}
|
||||
@@ -234,6 +235,7 @@ void PacketSender::open_l2_socket(const NetworkInterface& iface) {
|
||||
}
|
||||
ether_socket_[iface.id()] = sock;
|
||||
#else
|
||||
Internals::unused(iface);
|
||||
if (ether_socket_ == INVALID_RAW_SOCKET) {
|
||||
ether_socket_ = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
|
||||
|
||||
@@ -284,6 +286,7 @@ void PacketSender::close_socket(SocketType type, const NetworkInterface& iface)
|
||||
}
|
||||
ether_socket_.erase(it);
|
||||
#elif !defined(_WIN32)
|
||||
Internals::unused(iface);
|
||||
if (ether_socket_ == INVALID_RAW_SOCKET) {
|
||||
throw invalid_socket_type();
|
||||
}
|
||||
@@ -294,6 +297,7 @@ void PacketSender::close_socket(SocketType type, const NetworkInterface& iface)
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
Internals::unused(iface);
|
||||
if (type >= SOCKETS_END || sockets_[type] == INVALID_RAW_SOCKET) {
|
||||
throw invalid_socket_type();
|
||||
}
|
||||
@@ -354,6 +358,8 @@ void PacketSender::send_l2(PDU& pdu,
|
||||
PDU::serialization_type buffer = pdu.serialize();
|
||||
|
||||
#ifdef TINS_HAVE_PACKET_SENDER_PCAP_SENDPACKET
|
||||
Internals::unused(len_addr);
|
||||
Internals::unused(link_addr);
|
||||
open_l2_socket(iface);
|
||||
pcap_t* handle = pcap_handles_[iface];
|
||||
const int buf_size = static_cast<int>(buffer.size());
|
||||
|
||||
Reference in New Issue
Block a user