|
version 1.1, 2013/07/29 19:37:40
|
version 1.1.1.5, 2023/09/27 11:02:07
|
|
Line 1
|
Line 1
|
| /* dnsmasq is Copyright (c) 2000-2013 Simon Kelley | /* dnsmasq is Copyright (c) 2000-2022 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 38 void slaac_add_addrs(struct dhcp_lease *lease, time_t
|
Line 38 void slaac_add_addrs(struct dhcp_lease *lease, time_t
|
| lease->slaac_address = NULL; |
lease->slaac_address = NULL; |
| |
|
| for (context = daemon->dhcp6; context; context = context->next) |
for (context = daemon->dhcp6; context; context = context->next) |
| if ((context->flags & CONTEXT_RA_NAME) && lease->last_interface == context->if_index) | if ((context->flags & CONTEXT_RA_NAME) && |
| | !(context->flags & CONTEXT_OLD) && |
| | lease->last_interface == context->if_index) |
| { |
{ |
| struct in6_addr addr = context->start6; |
struct in6_addr addr = context->start6; |
| if (lease->hwaddr_len == 6 && |
if (lease->hwaddr_len == 6 && |
|
Line 91 void slaac_add_addrs(struct dhcp_lease *lease, time_t
|
Line 93 void slaac_add_addrs(struct dhcp_lease *lease, time_t
|
| slaac->ping_time = now; |
slaac->ping_time = now; |
| slaac->backoff = 1; |
slaac->backoff = 1; |
| slaac->addr = addr; |
slaac->addr = addr; |
| slaac->local = context->local6; |
|
| /* Do RA's to prod it */ |
/* Do RA's to prod it */ |
| ra_start_unsolicted(now, context); | ra_start_unsolicited(now, context); |
| } |
} |
| |
|
| if (slaac) |
if (slaac) |
|
Line 123 time_t periodic_slaac(time_t now, struct dhcp_lease *l
|
Line 124 time_t periodic_slaac(time_t now, struct dhcp_lease *l
|
| time_t next_event = 0; |
time_t next_event = 0; |
| |
|
| for (context = daemon->dhcp6; context; context = context->next) |
for (context = daemon->dhcp6; context; context = context->next) |
| if ((context->flags & CONTEXT_RA_NAME)) | if ((context->flags & CONTEXT_RA_NAME) && !(context->flags & CONTEXT_OLD)) |
| break; |
break; |
| |
|
| /* nothing configured */ |
/* nothing configured */ |
|
Line 145 time_t periodic_slaac(time_t now, struct dhcp_lease *l
|
Line 146 time_t periodic_slaac(time_t now, struct dhcp_lease *l
|
| struct ping_packet *ping; |
struct ping_packet *ping; |
| struct sockaddr_in6 addr; |
struct sockaddr_in6 addr; |
| |
|
| save_counter(0); | reset_counter(); |
| ping = expand(sizeof(struct ping_packet)); | |
| | if (!(ping = expand(sizeof(struct ping_packet)))) |
| | continue; |
| | |
| ping->type = ICMP6_ECHO_REQUEST; |
ping->type = ICMP6_ECHO_REQUEST; |
| ping->code = 0; |
ping->code = 0; |
| ping->identifier = ping_id; |
ping->identifier = ping_id; |
|
Line 160 time_t periodic_slaac(time_t now, struct dhcp_lease *l
|
Line 164 time_t periodic_slaac(time_t now, struct dhcp_lease *l
|
| addr.sin6_port = htons(IPPROTO_ICMPV6); |
addr.sin6_port = htons(IPPROTO_ICMPV6); |
| addr.sin6_addr = slaac->addr; |
addr.sin6_addr = slaac->addr; |
| |
|
| if (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(0), 0, | if (sendto(daemon->icmp6fd, daemon->outpacket.iov_base, save_counter(-1), 0, |
| (struct sockaddr *)&addr, sizeof(addr)) == -1 && |
(struct sockaddr *)&addr, sizeof(addr)) == -1 && |
| errno == EHOSTUNREACH) | errno == EHOSTUNREACH && |
| | slaac->backoff == 12) |
| slaac->ping_time = 0; /* Give up */ |
slaac->ping_time = 0; /* Give up */ |
| else |
else |
| { |
{ |
|
Line 198 void slaac_ping_reply(struct in6_addr *sender, unsigne
|
Line 203 void slaac_ping_reply(struct in6_addr *sender, unsigne
|
| slaac->backoff = 0; |
slaac->backoff = 0; |
| gotone = 1; |
gotone = 1; |
| inet_ntop(AF_INET6, sender, daemon->addrbuff, ADDRSTRLEN); |
inet_ntop(AF_INET6, sender, daemon->addrbuff, ADDRSTRLEN); |
| my_syslog(MS_DHCP | LOG_INFO, "SLAAC-CONFIRM(%s) %s %s", interface, daemon->addrbuff, lease->hostname); | if (!option_bool(OPT_QUIET_DHCP6)) |
| | my_syslog(MS_DHCP | LOG_INFO, "SLAAC-CONFIRM(%s) %s %s", interface, daemon->addrbuff, lease->hostname); |
| } |
} |
| |
|
| lease_update_dns(gotone); |
lease_update_dns(gotone); |