Skip to content

Commit

Permalink
DHCP6: For Prefix Delegation, the - interface means no assignment
Browse files Browse the repository at this point in the history
- is an invalid interface name.
So we take this to mean don't assign the Delegated Prefix to
any interfaces.
The reject route for the Delegated Prefix is still installed.

Fixes #270
  • Loading branch information
rsmarples committed Dec 18, 2023
1 parent c7a142a commit 01de6f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/dhcp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -3871,8 +3871,9 @@ dhcp6_activateinterfaces(struct interface *ifp)
sla = &ia->sla[j];
ifd = if_find(ifp->ctx->ifaces, sla->ifname);
if (ifd == NULL) {
logwarn("%s: cannot delegate to %s",
ifp->name, sla->ifname);
if (*sla->ifname != '-')
logwarn("%s: cannot delegate to %s",
ifp->name, sla->ifname);
continue;
}
if (!ifd->active) {
Expand Down
4 changes: 3 additions & 1 deletion src/dhcpcd.conf.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 4, 2023
.Dd December 18, 2023
.Dt DHCPCD.CONF 5
.Os
.Sh NAME
Expand Down Expand Up @@ -359,6 +359,7 @@ Otherwise addresses are only assigned for each
.Ar interface
and
.Ar sla_id .
To avoid delegating to any interface, use - as the invalid interface name.
Each assigned address will have a
.Ar suffix ,
defaulting to 1.
Expand Down Expand Up @@ -415,6 +416,7 @@ interface eth0
ia_na 1 # request an IPv6 address
ia_pd 2 eth1/0 # request a PD and assign it to eth1
ia_pd 3 eth2/1 eth3/2 # req a PD and assign it to eth2 and eth3
ia_pd 4 - # request a PD but don't assign it
.Ed
.It Ic ipv4only
Only configure IPv4.
Expand Down

0 comments on commit 01de6f2

Please sign in to comment.