version 1.1.1.2, 2014/06/15 16:31:38
|
version 1.1.1.3, 2016/11/02 09:57:01
|
Line 1
|
Line 1
|
/* dnsmasq is Copyright (c) 2000-2014 Simon Kelley | /* dnsmasq is Copyright (c) 2000-2016 Simon Kelley |
|
|
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
Line 20
|
Line 20
|
#include <ifaddrs.h> |
#include <ifaddrs.h> |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
|
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) |
#include <sys/sysctl.h> |
#include <sys/sysctl.h> |
|
#endif |
#include <net/if.h> |
#include <net/if.h> |
#include <net/route.h> |
#include <net/route.h> |
#include <net/if_dl.h> |
#include <net/if_dl.h> |
Line 359 void send_via_bpf(struct dhcp_packet *mess, size_t len
|
Line 361 void send_via_bpf(struct dhcp_packet *mess, size_t len
|
iov[3].iov_base = mess; |
iov[3].iov_base = mess; |
iov[3].iov_len = len; |
iov[3].iov_len = len; |
|
|
while (writev(daemon->dhcp_raw_fd, iov, 4) == -1 && retry_send()); | while (retry_send(writev(daemon->dhcp_raw_fd, iov, 4))); |
} |
} |
|
|
#endif /* defined(HAVE_BSD_NETWORK) && defined(HAVE_DHCP) */ |
#endif /* defined(HAVE_BSD_NETWORK) && defined(HAVE_DHCP) */ |
Line 376 void route_init(void)
|
Line 378 void route_init(void)
|
die(_("cannot create PF_ROUTE socket: %s"), NULL, EC_BADNET); |
die(_("cannot create PF_ROUTE socket: %s"), NULL, EC_BADNET); |
} |
} |
|
|
void route_sock(time_t now) | void route_sock(void) |
{ |
{ |
struct if_msghdr *msg; |
struct if_msghdr *msg; |
int rc = recv(daemon->routefd, daemon->packet, daemon->packet_buff_sz, 0); |
int rc = recv(daemon->routefd, daemon->packet, daemon->packet_buff_sz, 0); |
Line 401 void route_sock(time_t now)
|
Line 403 void route_sock(time_t now)
|
else if (msg->ifm_type == RTM_NEWADDR) |
else if (msg->ifm_type == RTM_NEWADDR) |
{ |
{ |
del_family = 0; |
del_family = 0; |
newaddress(now); | queue_event(EVENT_NEWADDR); |
} |
} |
else if (msg->ifm_type == RTM_DELADDR) |
else if (msg->ifm_type == RTM_DELADDR) |
{ |
{ |
Line 439 void route_sock(time_t now)
|
Line 441 void route_sock(time_t now)
|
of += sizeof(long) - (diff & (sizeof(long) - 1)); |
of += sizeof(long) - (diff & (sizeof(long) - 1)); |
} |
} |
|
|
newaddress(now); | queue_event(EVENT_NEWADDR); |
} |
} |
} |
} |
|
|