|
@@ -72,6 +72,12 @@ void Option6AddrLst::pack(isc::util::OutputBuffer& buf) {
|
|
|
|
|
|
for (AddressContainer::const_iterator addr=addrs_.begin();
|
|
|
addr!=addrs_.end(); ++addr) {
|
|
|
+ if (!addr->isV6()) {
|
|
|
+ isc_throw(isc::BadValue, addr->toText()
|
|
|
+ << " is not an IPv6 address");
|
|
|
+ }
|
|
|
+ // If an address is IPv6 address it should have assumed
|
|
|
+ // length of V6ADDRESS_LEN.
|
|
|
buf.writeData(&addr->toBytes()[0], V6ADDRESS_LEN);
|
|
|
}
|
|
|
}
|
|
@@ -104,8 +110,7 @@ std::string Option6AddrLst::toText(int indent /* =0 */) {
|
|
|
}
|
|
|
|
|
|
uint16_t Option6AddrLst::len() {
|
|
|
-
|
|
|
- return (OPTION6_HDR_LEN + addrs_.size()*V6ADDRESS_LEN);
|
|
|
+ return (OPTION6_HDR_LEN + addrs_.size() * V6ADDRESS_LEN);
|
|
|
}
|
|
|
|
|
|
} // end of namespace isc::dhcp
|