sla = &asla;
} else if (sla->prefix_len == 0) {
asla.sla = sla->sla;
- if (asla.sla == 0)
- asla.prefix_len = prefix->prefix_len;
- else
- asla.prefix_len = 0;
+ asla.prefix_len = 0;
sla = &asla;
}
if (sla->prefix_len == 0) {
prefix->prefix_len);
}
- if (sla->sla == 0) {
- *addr = prefix->prefix;
- } else if (ipv6_userprefix(&prefix->prefix, prefix->prefix_len,
+ if (ipv6_userprefix(&prefix->prefix, prefix->prefix_len,
sla->sla, addr, sla->prefix_len) == -1)
{
sa = inet_ntop(AF_INET6, &prefix->prefix,
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 16, 2016
+.Dd April 21, 2016
.Dt DHCPCD.CONF 5
.Os
.Sh NAME
is increased to the highest multiple of 8 that can accommodate the
.Ar sla_id .
.Ar sla_id
-is an integer and is added to the prefix which must fit inside
+is an integer which must be unique inside the
+.Ar iaid
+and is added to the prefix which must fit inside
.Ar prefix_len
less the length of the delegated prefix.
-.Ar sla_id
-can be 0 only if the Delegated Prefix is assigned to one interface.
-This violates RFC3633 12.1 and should only be used if the Delegated Prefix
-length is 64 and you need to delegate it to a downstream interface.
You can specify multiple
.Ar interface /
.Ar sla_id /
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
- # we cannot use SLA 0 above because we are
- # assinging the PD to more than one interface
.Ed
.It Ic ipv4only
Only configure IPv4.
ifname);
goto err_sla;
}
- if (sla->sla == 0) {
- logger(ctx, LOG_WARNING,
- "%s: sla of 0 is not "
- "RFC3633 (section 12.1) "
- "compliant",
- ifname);
- }
}
p = np;
}
sla->ifname);
goto err_sla;
}
- if (slap->sla_set &&
- (slap->sla == 0 || sla->sla == 0))
+ if (slap->sla_set && sla->sla_set &&
+ slap->sla == sla->sla)
{
logger(ctx, LOG_ERR, "%s: cannot"
- " assign multiple prefixes"
- " with a SLA of 0",
- ifname);
+ " assign the same SLA %u"
+ " more than once",
+ sla->ifname, sla->sla);
goto err_sla;
}
}
uint64_t vh, vl, user_low, user_high;
if (prefix_len < 1 || prefix_len > 128 ||
- result_len < 1 || result_len > 128 ||
- user_number == 0)
+ result_len < 1 || result_len > 128)
{
errno = EINVAL;
return -1;
return -1;
}
+ /* If user_number is zero, just copy the prefix into the result. */
+ if (user_number == 0) {
+ *result = *prefix;
+ return 0;
+ }
+
/* Shift user_number so it fit's just inside result_len.
* Shifting by 0 or sizeof(user_number) is undefined,
* so we cater for that. */