Constant correctness: socket(PF_*, ...) -> socket(AF_*, ...)
This commit is contained in:
@@ -69,7 +69,7 @@ static int arpping(struct client_state_t *cs, uint32_t test_ip,
|
||||
struct arpMsg arp;
|
||||
|
||||
if (cs->arpFd == -1) {
|
||||
int arpfd = socket(PF_PACKET, SOCK_PACKET, htons(ETH_P_ARP));
|
||||
int arpfd = socket(AF_PACKET, SOCK_PACKET, htons(ETH_P_ARP));
|
||||
if (arpfd == -1) {
|
||||
log_error("arp: failed to create socket: %s", strerror(errno));
|
||||
return -1;
|
||||
|
@@ -64,7 +64,7 @@ int nl_open(struct client_state_t *cs)
|
||||
|
||||
assert(cs->nlFd == -1);
|
||||
|
||||
cs->nlFd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
|
||||
cs->nlFd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
|
||||
|
||||
if (cs->nlFd == -1)
|
||||
return -1;
|
||||
|
@@ -56,7 +56,7 @@ static int create_udp_listen_socket(unsigned int ip, int port, char *inf)
|
||||
int opt = 1;
|
||||
|
||||
log_line("Opening listen socket on 0x%08x:%d %s", ip, port, inf);
|
||||
if ((fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
|
||||
if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
|
||||
log_error("create_udp_listen_socket: socket failed: %s",
|
||||
strerror(errno));
|
||||
goto out;
|
||||
@@ -364,7 +364,7 @@ int kernel_packet(struct dhcpMessage *payload, uint32_t source_ip,
|
||||
int opt = 1, fd, result = -1;
|
||||
unsigned int padding;
|
||||
|
||||
if ((fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
|
||||
if ((fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
|
||||
goto out;
|
||||
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof opt) == -1)
|
||||
|
Reference in New Issue
Block a user