DHCPv6 option just called prefix.
Send delegated interfaces to listeners as well.
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))
}
}
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" */
#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) \
.\" 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
.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
.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
}
#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) {