Use AF_INET instead of PF_INET
I believe it should be more portable this way, since AF_INET is required to be present in <sys/socket.h> in POSIX.
This commit is contained in:
+3
-3
@@ -230,7 +230,7 @@ send_spa_packet_tcp_raw(const char *spa_data, const int sd_len,
|
||||
return res;
|
||||
}
|
||||
|
||||
sock = socket (PF_INET, SOCK_RAW, IPPROTO_RAW);
|
||||
sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW);
|
||||
if (sock < 0)
|
||||
{
|
||||
log_msg(LOG_VERBOSITY_ERROR, "send_spa_packet_tcp_raw: create socket: ", strerror(errno));
|
||||
@@ -343,7 +343,7 @@ send_spa_packet_udp_raw(const char *spa_data, const int sd_len,
|
||||
return res;
|
||||
}
|
||||
|
||||
sock = socket (PF_INET, SOCK_RAW, IPPROTO_RAW);
|
||||
sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW);
|
||||
if (sock < 0)
|
||||
{
|
||||
log_msg(LOG_VERBOSITY_ERROR, "send_spa_packet_udp_raw: create socket: ", strerror(errno));
|
||||
@@ -441,7 +441,7 @@ send_spa_packet_icmp(const char *spa_data, const int sd_len,
|
||||
return res;
|
||||
}
|
||||
|
||||
sock = socket (PF_INET, SOCK_RAW, IPPROTO_RAW);
|
||||
sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW);
|
||||
|
||||
if (sock < 0)
|
||||
{
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ run_tcp_server(fko_srv_options_t *opts)
|
||||
|
||||
/* Now, let's make a TCP server
|
||||
*/
|
||||
if ((s_sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
|
||||
if ((s_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
|
||||
{
|
||||
log_msg(LOG_ERR, "run_tcp_server: socket() failed: %s",
|
||||
strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user