| 1 |
/* dnsmasq is Copyright (c) 2000-2026 Simon Kelley |
| 2 |
|
| 3 |
This program is free software; you can redistribute it and/or modify |
| 4 |
it under the terms of the GNU General Public License as published by |
| 5 |
the Free Software Foundation; version 2 dated June, 1991, or |
| 6 |
(at your option) version 3 dated 29 June, 2007. |
| 7 |
|
| 8 |
This program is distributed in the hope that it will be useful, |
| 9 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
GNU General Public License for more details. |
| 12 |
|
| 13 |
You should have received a copy of the GNU General Public License |
| 14 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include "dnsmasq.h" |
| 18 |
|
| 19 |
#if defined(HAVE_BSD_NETWORK) || defined(HAVE_SOLARIS_NETWORK) |
| 20 |
#include <ifaddrs.h> |
| 21 |
|
| 22 |
#include <sys/param.h> |
| 23 |
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) |
| 24 |
#include <sys/sysctl.h> |
| 25 |
#endif |
| 26 |
#include <net/if.h> |
| 27 |
#include <net/route.h> |
| 28 |
#include <net/if_dl.h> |
| 29 |
#include <netinet/if_ether.h> |
| 30 |
#if defined(__FreeBSD__) |
| 31 |
# include <net/if_var.h> |
| 32 |
#endif |
| 33 |
#include <netinet/in_var.h> |
| 34 |
#include <netinet6/in6_var.h> |
| 35 |
|
| 36 |
#ifndef SA_SIZE |
| 37 |
#define SA_SIZE(sa) \ |
| 38 |
( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \ |
| 39 |
sizeof(long) : \ |
| 40 |
1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) |
| 41 |
#endif |
| 42 |
|
| 43 |
#ifdef HAVE_BSD_NETWORK |
| 44 |
static int del_family = 0; |
| 45 |
static union all_addr del_addr; |
| 46 |
#endif |
| 47 |
|
| 48 |
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) |
| 49 |
|
| 50 |
static int arp_enumerate_family(int family, void *parm, callback_t callback) |
| 51 |
{ |
| 52 |
int mib[6]; |
| 53 |
size_t needed; |
| 54 |
char *next; |
| 55 |
struct rt_msghdr *rtm; |
| 56 |
struct sockaddr_dl *sdl; |
| 57 |
static struct iovec buff = { NULL, 0 }; |
| 58 |
int rc; |
| 59 |
|
| 60 |
mib[0] = CTL_NET; |
| 61 |
mib[1] = PF_ROUTE; |
| 62 |
mib[2] = 0; |
| 63 |
mib[3] = family; |
| 64 |
mib[4] = NET_RT_FLAGS; |
| 65 |
#ifdef RTF_LLINFO |
| 66 |
mib[5] = RTF_LLINFO; |
| 67 |
#else |
| 68 |
mib[5] = 0; |
| 69 |
#endif |
| 70 |
if (sysctl(mib, 6, NULL, &needed, NULL, 0) == -1 || needed == 0) |
| 71 |
return 1; /* not a failure: unsupported or empty table */ |
| 72 |
|
| 73 |
while (1) |
| 74 |
{ |
| 75 |
if (!expand_buf(&buff, needed)) |
| 76 |
return 0; |
| 77 |
if ((rc = sysctl(mib, 6, buff.iov_base, &needed, NULL, 0)) == 0 || |
| 78 |
errno != ENOMEM) |
| 79 |
break; |
| 80 |
needed += needed / 8; |
| 81 |
} |
| 82 |
|
| 83 |
if (rc == -1) |
| 84 |
return 0; |
| 85 |
|
| 86 |
for (next = buff.iov_base ; next < (char *)buff.iov_base + needed; next += rtm->rtm_msglen) |
| 87 |
{ |
| 88 |
rtm = (struct rt_msghdr *)next; |
| 89 |
if (family == AF_INET) |
| 90 |
{ |
| 91 |
struct sockaddr_inarp *sin2 = (struct sockaddr_inarp *)(rtm + 1); |
| 92 |
sdl = (struct sockaddr_dl *)((char *)sin2 + SA_SIZE(sin2)); |
| 93 |
if (!callback.af_unspec(AF_INET, &sin2->sin_addr, |
| 94 |
LLADDR(sdl), sdl->sdl_alen, parm)) |
| 95 |
return 0; |
| 96 |
} |
| 97 |
else |
| 98 |
{ |
| 99 |
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)(rtm + 1); |
| 100 |
sdl = (struct sockaddr_dl *)((char *)sin6 + SA_SIZE(sin6)); |
| 101 |
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) |
| 102 |
{ |
| 103 |
/* PF_ROUTE sysctl returns raw kernel structures with the interface |
| 104 |
index embedded in bytes 2-3 of link-local addresses. Extract it |
| 105 |
into sin6_scope_id per the KAME API contract before clearing. */ |
| 106 |
sin6->sin6_scope_id = |
| 107 |
((uint32_t)(sin6->sin6_addr.s6_addr[2]) << 8) | sin6->sin6_addr.s6_addr[3]; |
| 108 |
sin6->sin6_addr.s6_addr[2] = 0; |
| 109 |
sin6->sin6_addr.s6_addr[3] = 0; |
| 110 |
} |
| 111 |
if (!callback.af_unspec(AF_INET6, &sin6->sin6_addr, |
| 112 |
LLADDR(sdl), sdl->sdl_alen, parm)) |
| 113 |
return 0; |
| 114 |
} |
| 115 |
} |
| 116 |
|
| 117 |
return 1; |
| 118 |
} |
| 119 |
|
| 120 |
static int arp_enumerate(void *parm, callback_t callback) |
| 121 |
{ |
| 122 |
if (!arp_enumerate_family(AF_INET, parm, callback)) |
| 123 |
return 0; |
| 124 |
return arp_enumerate_family(AF_INET6, parm, callback); |
| 125 |
} |
| 126 |
#endif /* defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) */ |
| 127 |
|
| 128 |
|
| 129 |
int iface_enumerate(int family, void *parm, callback_t callback) |
| 130 |
{ |
| 131 |
struct ifaddrs *head, *addrs; |
| 132 |
int errsave, fd = -1, ret = 0; |
| 133 |
|
| 134 |
if (family == AF_UNSPEC) |
| 135 |
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) |
| 136 |
return arp_enumerate(parm, callback); |
| 137 |
#else |
| 138 |
return 0; /* need code for Solaris and MacOS*/ |
| 139 |
#endif |
| 140 |
|
| 141 |
/* AF_LINK doesn't exist in Linux, so we can't use it in our API */ |
| 142 |
if (family == AF_LOCAL) |
| 143 |
family = AF_LINK; |
| 144 |
|
| 145 |
if (getifaddrs(&head) == -1) |
| 146 |
return 0; |
| 147 |
|
| 148 |
#if defined(HAVE_BSD_NETWORK) |
| 149 |
if (family == AF_INET6) |
| 150 |
fd = socket(PF_INET6, SOCK_DGRAM, 0); |
| 151 |
#endif |
| 152 |
|
| 153 |
for (addrs = head; addrs; addrs = addrs->ifa_next) |
| 154 |
{ |
| 155 |
int iface_index = if_nametoindex(addrs->ifa_name); |
| 156 |
|
| 157 |
if (iface_index == 0 || !addrs->ifa_addr || |
| 158 |
addrs->ifa_addr->sa_family != family || |
| 159 |
(!addrs->ifa_netmask && family != AF_LINK)) |
| 160 |
continue; |
| 161 |
|
| 162 |
if (family == AF_INET) |
| 163 |
{ |
| 164 |
struct in_addr addr, netmask, broadcast; |
| 165 |
addr = ((struct sockaddr_in *) addrs->ifa_addr)->sin_addr; |
| 166 |
#ifdef HAVE_BSD_NETWORK |
| 167 |
if (del_family == AF_INET && del_addr.addr4.s_addr == addr.s_addr) |
| 168 |
continue; |
| 169 |
#endif |
| 170 |
netmask = ((struct sockaddr_in *) addrs->ifa_netmask)->sin_addr; |
| 171 |
if (addrs->ifa_broadaddr) |
| 172 |
broadcast = ((struct sockaddr_in *) addrs->ifa_broadaddr)->sin_addr; |
| 173 |
else |
| 174 |
broadcast.s_addr = 0; |
| 175 |
if (!callback.af_inet(addr, iface_index, NULL, netmask, broadcast, parm)) |
| 176 |
goto err; |
| 177 |
} |
| 178 |
else if (family == AF_INET6) |
| 179 |
{ |
| 180 |
struct in6_addr *addr = &((struct sockaddr_in6 *) addrs->ifa_addr)->sin6_addr; |
| 181 |
unsigned char *netmask = (unsigned char *) &((struct sockaddr_in6 *) addrs->ifa_netmask)->sin6_addr; |
| 182 |
int scope_id = ((struct sockaddr_in6 *) addrs->ifa_addr)->sin6_scope_id; |
| 183 |
int i, j, prefix = 0; |
| 184 |
u32 valid = 0xffffffff, preferred = 0xffffffff; |
| 185 |
int flags = 0; |
| 186 |
#ifdef HAVE_BSD_NETWORK |
| 187 |
if (del_family == AF_INET6 && IN6_ARE_ADDR_EQUAL(&del_addr.addr6, addr)) |
| 188 |
continue; |
| 189 |
#endif |
| 190 |
#if defined(HAVE_BSD_NETWORK) && !defined(__APPLE__) |
| 191 |
struct in6_ifreq ifr6; |
| 192 |
|
| 193 |
memset(&ifr6, 0, sizeof(ifr6)); |
| 194 |
safe_strncpy(ifr6.ifr_name, addrs->ifa_name, sizeof(ifr6.ifr_name)); |
| 195 |
|
| 196 |
ifr6.ifr_addr = *((struct sockaddr_in6 *) addrs->ifa_addr); |
| 197 |
if (fd != -1 && ioctl(fd, SIOCGIFAFLAG_IN6, &ifr6) != -1) |
| 198 |
{ |
| 199 |
if (ifr6.ifr_ifru.ifru_flags6 & IN6_IFF_TENTATIVE) |
| 200 |
flags |= IFACE_TENTATIVE; |
| 201 |
|
| 202 |
if (ifr6.ifr_ifru.ifru_flags6 & IN6_IFF_DEPRECATED) |
| 203 |
flags |= IFACE_DEPRECATED; |
| 204 |
|
| 205 |
#ifdef IN6_IFF_TEMPORARY |
| 206 |
if (!(ifr6.ifr_ifru.ifru_flags6 & (IN6_IFF_AUTOCONF | IN6_IFF_TEMPORARY))) |
| 207 |
flags |= IFACE_PERMANENT; |
| 208 |
#endif |
| 209 |
|
| 210 |
#ifdef IN6_IFF_PRIVACY |
| 211 |
if (!(ifr6.ifr_ifru.ifru_flags6 & (IN6_IFF_AUTOCONF | IN6_IFF_PRIVACY))) |
| 212 |
flags |= IFACE_PERMANENT; |
| 213 |
#endif |
| 214 |
} |
| 215 |
|
| 216 |
ifr6.ifr_addr = *((struct sockaddr_in6 *) addrs->ifa_addr); |
| 217 |
if (fd != -1 && ioctl(fd, SIOCGIFALIFETIME_IN6, &ifr6) != -1) |
| 218 |
{ |
| 219 |
valid = ifr6.ifr_ifru.ifru_lifetime.ia6t_vltime; |
| 220 |
preferred = ifr6.ifr_ifru.ifru_lifetime.ia6t_pltime; |
| 221 |
} |
| 222 |
#endif |
| 223 |
|
| 224 |
for (i = 0; i < IN6ADDRSZ; i++, prefix += 8) |
| 225 |
if (netmask[i] != 0xff) |
| 226 |
break; |
| 227 |
|
| 228 |
if (i != IN6ADDRSZ && netmask[i]) |
| 229 |
for (j = 7; j > 0; j--, prefix++) |
| 230 |
if ((netmask[i] & (1 << j)) == 0) |
| 231 |
break; |
| 232 |
|
| 233 |
/* voodoo to clear interface field in address */ |
| 234 |
if (!option_bool(OPT_NOWILD) && IN6_IS_ADDR_LINKLOCAL(addr)) |
| 235 |
{ |
| 236 |
addr->s6_addr[2] = 0; |
| 237 |
addr->s6_addr[3] = 0; |
| 238 |
} |
| 239 |
|
| 240 |
if (!callback.af_inet6(addr, prefix, scope_id, iface_index, flags, |
| 241 |
(unsigned int) preferred, (unsigned int)valid, parm)) |
| 242 |
goto err; |
| 243 |
} |
| 244 |
|
| 245 |
#ifdef HAVE_DHCP6 |
| 246 |
else if (family == AF_LINK) |
| 247 |
{ |
| 248 |
/* Assume ethernet again here */ |
| 249 |
struct sockaddr_dl *sdl = (struct sockaddr_dl *) addrs->ifa_addr; |
| 250 |
if (sdl->sdl_alen != 0 && |
| 251 |
!callback.af_local(iface_index, ARPHRD_ETHER, LLADDR(sdl), sdl->sdl_alen, parm)) |
| 252 |
goto err; |
| 253 |
} |
| 254 |
#endif |
| 255 |
} |
| 256 |
|
| 257 |
ret = 1; |
| 258 |
|
| 259 |
err: |
| 260 |
errsave = errno; |
| 261 |
freeifaddrs(head); |
| 262 |
if (fd != -1) |
| 263 |
close(fd); |
| 264 |
errno = errsave; |
| 265 |
|
| 266 |
return ret; |
| 267 |
} |
| 268 |
#endif /* defined(HAVE_BSD_NETWORK) || defined(HAVE_SOLARIS_NETWORK) */ |
| 269 |
|
| 270 |
|
| 271 |
#if defined(HAVE_BSD_NETWORK) && defined(HAVE_DHCP) |
| 272 |
#include <net/bpf.h> |
| 273 |
|
| 274 |
void init_bpf(void) |
| 275 |
{ |
| 276 |
int i = 0; |
| 277 |
|
| 278 |
while (1) |
| 279 |
{ |
| 280 |
sprintf(daemon->dhcp_buff, "/dev/bpf%d", i++); |
| 281 |
if ((daemon->dhcp_raw_fd = open(daemon->dhcp_buff, O_RDWR, 0)) != -1) |
| 282 |
return; |
| 283 |
|
| 284 |
if (errno != EBUSY) |
| 285 |
die(_("cannot create DHCP BPF socket: %s"), NULL, EC_BADNET); |
| 286 |
} |
| 287 |
} |
| 288 |
|
| 289 |
void send_via_bpf(struct dhcp_packet *mess, size_t len, |
| 290 |
struct in_addr iface_addr, struct ifreq *ifr) |
| 291 |
{ |
| 292 |
/* Hairy stuff, packet either has to go to the |
| 293 |
net broadcast or the destination can't reply to ARP yet, |
| 294 |
but we do know the physical address. |
| 295 |
Build the packet by steam, and send directly, bypassing |
| 296 |
the kernel IP stack */ |
| 297 |
|
| 298 |
struct ether_header ether; |
| 299 |
struct ip ip; |
| 300 |
struct udphdr { |
| 301 |
u16 uh_sport; /* source port */ |
| 302 |
u16 uh_dport; /* destination port */ |
| 303 |
u16 uh_ulen; /* udp length */ |
| 304 |
u16 uh_sum; /* udp checksum */ |
| 305 |
} udp; |
| 306 |
|
| 307 |
u32 i, sum; |
| 308 |
struct iovec iov[4]; |
| 309 |
|
| 310 |
/* Only know how to do ethernet on *BSD */ |
| 311 |
if (mess->htype != ARPHRD_ETHER || mess->hlen != ETHER_ADDR_LEN) |
| 312 |
{ |
| 313 |
my_syslog(MS_DHCP | LOG_WARNING, _("DHCP request for unsupported hardware type (%d) received on %s"), |
| 314 |
mess->htype, ifr->ifr_name); |
| 315 |
return; |
| 316 |
} |
| 317 |
|
| 318 |
ifr->ifr_addr.sa_family = AF_LINK; |
| 319 |
if (ioctl(daemon->dhcpfd, SIOCGIFADDR, ifr) < 0) |
| 320 |
return; |
| 321 |
|
| 322 |
memcpy(ether.ether_shost, LLADDR((struct sockaddr_dl *)&ifr->ifr_addr), ETHER_ADDR_LEN); |
| 323 |
ether.ether_type = htons(ETHERTYPE_IP); |
| 324 |
|
| 325 |
if (ntohs(mess->flags) & 0x8000) |
| 326 |
{ |
| 327 |
memset(ether.ether_dhost, 255, ETHER_ADDR_LEN); |
| 328 |
ip.ip_dst.s_addr = INADDR_BROADCAST; |
| 329 |
} |
| 330 |
else |
| 331 |
{ |
| 332 |
memcpy(ether.ether_dhost, mess->chaddr, ETHER_ADDR_LEN); |
| 333 |
ip.ip_dst.s_addr = mess->yiaddr.s_addr; |
| 334 |
} |
| 335 |
|
| 336 |
ip.ip_p = IPPROTO_UDP; |
| 337 |
ip.ip_src.s_addr = iface_addr.s_addr; |
| 338 |
ip.ip_len = htons(sizeof(struct ip) + |
| 339 |
sizeof(struct udphdr) + |
| 340 |
len) ; |
| 341 |
ip.ip_hl = sizeof(struct ip) / 4; |
| 342 |
ip.ip_v = IPVERSION; |
| 343 |
ip.ip_tos = 0; |
| 344 |
ip.ip_id = htons(0); |
| 345 |
ip.ip_off = htons(0x4000); /* don't fragment */ |
| 346 |
ip.ip_ttl = IPDEFTTL; |
| 347 |
ip.ip_sum = 0; |
| 348 |
for (sum = 0, i = 0; i < sizeof(struct ip) / 2; i++) |
| 349 |
sum += ((u16 *)&ip)[i]; |
| 350 |
while (sum>>16) |
| 351 |
sum = (sum & 0xffff) + (sum >> 16); |
| 352 |
ip.ip_sum = (sum == 0xffff) ? sum : ~sum; |
| 353 |
|
| 354 |
udp.uh_sport = htons(daemon->dhcp_server_port); |
| 355 |
udp.uh_dport = htons(daemon->dhcp_client_port); |
| 356 |
if (len & 1) |
| 357 |
((char *)mess)[len] = 0; /* for checksum, in case length is odd. */ |
| 358 |
udp.uh_sum = 0; |
| 359 |
udp.uh_ulen = sum = htons(sizeof(struct udphdr) + len); |
| 360 |
sum += htons(IPPROTO_UDP); |
| 361 |
sum += ip.ip_src.s_addr & 0xffff; |
| 362 |
sum += (ip.ip_src.s_addr >> 16) & 0xffff; |
| 363 |
sum += ip.ip_dst.s_addr & 0xffff; |
| 364 |
sum += (ip.ip_dst.s_addr >> 16) & 0xffff; |
| 365 |
for (i = 0; i < sizeof(struct udphdr)/2; i++) |
| 366 |
sum += ((u16 *)&udp)[i]; |
| 367 |
for (i = 0; i < (len + 1) / 2; i++) |
| 368 |
sum += ((u16 *)mess)[i]; |
| 369 |
while (sum>>16) |
| 370 |
sum = (sum & 0xffff) + (sum >> 16); |
| 371 |
udp.uh_sum = (sum == 0xffff) ? sum : ~sum; |
| 372 |
|
| 373 |
ioctl(daemon->dhcp_raw_fd, BIOCSETIF, ifr); |
| 374 |
|
| 375 |
iov[0].iov_base = ðer; |
| 376 |
iov[0].iov_len = sizeof(ether); |
| 377 |
iov[1].iov_base = &ip; |
| 378 |
iov[1].iov_len = sizeof(ip); |
| 379 |
iov[2].iov_base = &udp; |
| 380 |
iov[2].iov_len = sizeof(udp); |
| 381 |
iov[3].iov_base = mess; |
| 382 |
iov[3].iov_len = len; |
| 383 |
|
| 384 |
while (retry_send(writev(daemon->dhcp_raw_fd, iov, 4))); |
| 385 |
} |
| 386 |
|
| 387 |
#endif /* defined(HAVE_BSD_NETWORK) && defined(HAVE_DHCP) */ |
| 388 |
|
| 389 |
|
| 390 |
#ifdef HAVE_BSD_NETWORK |
| 391 |
|
| 392 |
void route_init(void) |
| 393 |
{ |
| 394 |
/* AF_UNSPEC: all addr families */ |
| 395 |
daemon->routefd = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC); |
| 396 |
|
| 397 |
if (daemon->routefd == -1 || !fix_fd(daemon->routefd)) |
| 398 |
die(_("cannot create PF_ROUTE socket: %s"), NULL, EC_BADNET); |
| 399 |
} |
| 400 |
|
| 401 |
void route_sock(void) |
| 402 |
{ |
| 403 |
struct if_msghdr *msg; |
| 404 |
int rc = recv(daemon->routefd, daemon->packet, daemon->packet_buff_sz, 0); |
| 405 |
|
| 406 |
if (rc < 4) |
| 407 |
return; |
| 408 |
|
| 409 |
msg = (struct if_msghdr *)daemon->packet; |
| 410 |
|
| 411 |
if (rc < msg->ifm_msglen) |
| 412 |
return; |
| 413 |
|
| 414 |
if (msg->ifm_version != RTM_VERSION) |
| 415 |
{ |
| 416 |
static int warned = 0; |
| 417 |
if (!warned) |
| 418 |
{ |
| 419 |
my_syslog(LOG_WARNING, _("Unknown protocol version from route socket")); |
| 420 |
warned = 1; |
| 421 |
} |
| 422 |
} |
| 423 |
else if (msg->ifm_type == RTM_NEWADDR) |
| 424 |
{ |
| 425 |
del_family = 0; |
| 426 |
queue_event(EVENT_NEWADDR); |
| 427 |
} |
| 428 |
else if (msg->ifm_type == RTM_DELADDR) |
| 429 |
{ |
| 430 |
/* There's a race in the kernel, such that if we run iface_enumerate() immediately |
| 431 |
we get a DELADDR event, the deleted address still appears. Here we store the deleted address |
| 432 |
in a static variable, and omit it from the set returned by iface_enumerate() */ |
| 433 |
int mask = ((struct ifa_msghdr *)msg)->ifam_addrs; |
| 434 |
int maskvec[] = { RTA_DST, RTA_GATEWAY, RTA_NETMASK, RTA_GENMASK, |
| 435 |
RTA_IFP, RTA_IFA, RTA_AUTHOR, RTA_BRD }; |
| 436 |
int of; |
| 437 |
unsigned int i; |
| 438 |
|
| 439 |
for (i = 0, of = sizeof(struct ifa_msghdr); of < rc && i < sizeof(maskvec)/sizeof(maskvec[0]); i++) |
| 440 |
if (mask & maskvec[i]) |
| 441 |
{ |
| 442 |
struct sockaddr *sa = (struct sockaddr *)((char *)msg + of); |
| 443 |
size_t diff = (sa->sa_len != 0) ? sa->sa_len : sizeof(long); |
| 444 |
|
| 445 |
if (maskvec[i] == RTA_IFA) |
| 446 |
{ |
| 447 |
del_family = sa->sa_family; |
| 448 |
if (del_family == AF_INET) |
| 449 |
del_addr.addr4 = ((struct sockaddr_in *)sa)->sin_addr; |
| 450 |
else if (del_family == AF_INET6) |
| 451 |
del_addr.addr6 = ((struct sockaddr_in6 *)sa)->sin6_addr; |
| 452 |
else |
| 453 |
del_family = 0; |
| 454 |
} |
| 455 |
|
| 456 |
of += diff; |
| 457 |
/* round up as needed */ |
| 458 |
if (diff & (sizeof(long) - 1)) |
| 459 |
of += sizeof(long) - (diff & (sizeof(long) - 1)); |
| 460 |
} |
| 461 |
|
| 462 |
queue_event(EVENT_NEWADDR); |
| 463 |
} |
| 464 |
} |
| 465 |
|
| 466 |
#endif /* HAVE_BSD_NETWORK */ |