Set arp socket as nonblocking.
This commit is contained in:
parent
6f483045f4
commit
11e71837fd
@ -17,6 +17,7 @@
|
||||
#include "arp.h"
|
||||
#include "dhcpmsg.h"
|
||||
#include "packet.h"
|
||||
#include "socket.h"
|
||||
#include "sys.h"
|
||||
#include "ifchange.h"
|
||||
#include "dhcpd.h"
|
||||
@ -50,6 +51,8 @@ static int arpping(uint32_t test_nip, const uint8_t *safe_mac,
|
||||
return -1;
|
||||
}
|
||||
|
||||
set_sock_nonblock(arpfd);
|
||||
|
||||
/* send arp request */
|
||||
memset(&arp, 0, sizeof arp);
|
||||
memset(arp.h_dest, 0xff, 6); /* MAC DA */
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "strl.h"
|
||||
#include "dhcpd.h" /* For SERVER_PORT and CLIENT_PORT */
|
||||
|
||||
static int set_sock_nonblock(int fd)
|
||||
int set_sock_nonblock(int fd)
|
||||
{
|
||||
int ret = 0, flags;
|
||||
flags = fcntl(fd, F_GETFL);
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* socket.h */
|
||||
#ifndef SOCKET_H_
|
||||
#define SOCKET_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
int set_sock_nonblock(int fd);
|
||||
int read_interface(char *interface, int *ifindex, uint32_t *addr,
|
||||
uint8_t *mac);
|
||||
int listen_socket(unsigned int ip, int port, char *inf);
|
||||
|
Loading…
Reference in New Issue
Block a user