mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
@@ -263,7 +263,8 @@ void PacketSender::open_l3_socket(SocketType type) {
|
|||||||
#else
|
#else
|
||||||
typedef const char* option_ptr;
|
typedef const char* option_ptr;
|
||||||
#endif
|
#endif
|
||||||
if (setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, (option_ptr)&on, sizeof(on)) != 0) {
|
const int level = (type == IPV6_SOCKET) ? IPPROTO_IPV6 : IPPROTO_IP;
|
||||||
|
if (setsockopt(sockfd, level, IP_HDRINCL, (option_ptr)&on, sizeof(on)) != 0) {
|
||||||
throw socket_open_error(make_error_string());
|
throw socket_open_error(make_error_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user