Rename dhcp6_prefix to delegated_dhcp6_prefix incase a user makes a

DHCPv6 option just called prefix.
Send delegated interfaces to listeners as well.
This commit is contained in:
Roy Marples 2014-10-03 17:54:06 +00:00
parent f9e1cf0303
commit 369d1314de
4 changed files with 10 additions and 9 deletions

View File

@ -1175,6 +1175,9 @@ dhcp6_dadcompleted(const struct interface *ifp)
const struct ipv6_addr *ap;
state = D6_CSTATE(ifp);
if (!TAILQ_FIRST(&state->addrs))
return 0;
TAILQ_FOREACH(ap, &state->addrs, next) {
if (ap->flags & IPV6_AF_ADDED &&
!(ap->flags & IPV6_AF_DADCOMPLETED))
@ -3393,13 +3396,13 @@ delegated:
}
}
if (env && i) {
i += strlen(prefix) + strlen("_dhcp6_prefix=");
i += strlen(prefix) + strlen("_delegated_dhcp6_prefix=");
v = val = env[n] = malloc(i);
if (v == NULL) {
syslog(LOG_ERR, "%s: %m", __func__);
return -1;
}
v += snprintf(val, i, "%s_dhcp6_prefix=", prefix);
v += snprintf(val, i, "%s_delegated_dhcp6_prefix=", prefix);
TAILQ_FOREACH(ap, &state->addrs, next) {
if (ap->delegating_iface) {
/* Can't use stpcpy(3) due to "security" */

View File

@ -208,7 +208,7 @@ struct dhcp6_state {
#define D6_CSTATE(ifp) \
((const struct dhcp6_state *)(ifp)->if_data[IF_DATA_DHCP6])
#define D6_STATE_RUNNING(ifp) \
(D6_CSTATE((ifp)) && D6_CSTATE((ifp))->new && \
(D6_CSTATE((ifp)) && \
D6_CSTATE((ifp))->reason && dhcp6_dadcompleted((ifp)))
#define D6_FIRST_OPTION(m) \

View File

@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd August 1, 2014
.Dd August 3, 2014
.Dt DHCPCD-RUN-HOOKS 8
.Os
.Sh NAME
@ -136,7 +136,7 @@ and
.Ev $RC_SVCNAME .
The following variables will then be set, along with any protocol supplied
ones.
.Bl -tag -width xnew_dhcp6_prefix
.Bl -tag -width xnew_delegated_dhcp6_prefix
.It Ev $interface
the name of the interface.
.It Ev $reason
@ -194,7 +194,7 @@ requirements specified in
.It Ev $profile
the name of the profile selected from
.Xr dhcpcd.conf 5 .
.It Ev $new_dhcp6_prefix
.It Ev $new_delegated_dhcp6_prefix
space separated list of delegated prefixes.
.El
.Sh FILES

View File

@ -462,9 +462,7 @@ dumplease:
}
#endif
#ifdef INET6
if (dhcp6 && d6_state &&
(d6_state->new || d6_state->state == DH6S_DELEGATED))
{
if (dhcp6 && D6_STATE_RUNNING(ifp)) {
n = dhcp6_env(NULL, NULL, ifp,
d6_state->new, d6_state->new_len);
if (n > 0) {