Skip to content

Commit ac52823

Browse files
committed
[#3802] Checkpoint
1 parent 03b8d44 commit ac52823

File tree

3 files changed

+134
-108
lines changed

3 files changed

+134
-108
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[func] fdupont
22
Added experimental support for registering self-generated
33
IPv6 addresses using DHCPv6 (RFC 9686).
4-
(Gitlab #3683)
4+
(Gitlab #3683, #3802)

src/bin/dhcp6/dhcp6_srv.cc

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4503,19 +4503,36 @@ Dhcpv6Srv::processAddrRegInform(AllocEngine::ClientContext6& ctx) {
45034503

45044504
// Check if the message is bad and shout be dropped.
45054505
try {
4506-
// Get IA_NA from the Address registration inform.
4506+
// Check there is no IA_NA option.
4507+
if (addr_reg_inf->getOption(D6O_IA_NA)) {
4508+
isc_throw(RFCViolation, "unexpected IA_NA option");
4509+
}
4510+
4511+
// Check there is no IA_TA option.
4512+
if (addr_reg_inf->getOption(D6O_IA_TA)) {
4513+
isc_throw(RFCViolation, "unexpected IA_TA option");
4514+
}
4515+
4516+
// Check there is no IA_PD option.
4517+
if (addr_reg_inf->getOption(D6O_IA_PD)) {
4518+
isc_throw(RFCViolation, "unexpected IA_PD option");
4519+
}
4520+
4521+
// Get IAADDR from the Address registration inform.
45074522
// There must be one.
45084523
OptionCollection addrs = addr_reg_inf->getOptions(D6O_IAADDR);
45094524
if (addrs.size() != 1) {
4510-
isc_throw(RFCViolation, "Exactly 1 IAADDRESS option expected, but "
4525+
isc_throw(RFCViolation, "Exactly 1 IAADDR option expected, but "
45114526
<< addrs.size() << " received");
45124527
}
45134528
iaaddr = boost::dynamic_pointer_cast<Option6IAAddr>(addrs.begin()->second);
45144529
if (!iaaddr) {
4515-
isc_throw(Unexpected, "can't convert the IAAddress option");
4530+
isc_throw(Unexpected, "can't convert the IAADDR option");
45164531
}
45174532

45184533
// Set per-IA context values.
4534+
// Note the address is considered as not-temporary address.
4535+
45194536
ctx.createIAContext();
45204537
ctx.currentIA().type_ = Lease::TYPE_NA;
45214538
ctx.currentIA().iaid_ = no_iaid;

0 commit comments

Comments
 (0)