Skip to content

Commit

Permalink
Don't error when setting too big of a Hwaddr
Browse files Browse the repository at this point in the history
The rest of the logic in Pkt4 seems to truncate it just fine, so saving
too big of an address should be safe.
  • Loading branch information
TimoRoth committed May 21, 2024
1 parent 3db8902 commit 549afba
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib/dhcp/pkt4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,13 +481,7 @@ void
Pkt4::setHWAddrMember(const uint8_t htype, const uint8_t hlen,
const std::vector<uint8_t>& mac_addr,
HWAddrPtr& hw_addr) {
/// @todo Rewrite this once support for client-identifier option
/// is implemented (ticket 1228?)
if (hlen > MAX_CHADDR_LEN) {
isc_throw(OutOfRange, "Hardware address (len=" << static_cast<uint32_t>(hlen)
<< ") too long. Max " << MAX_CHADDR_LEN << " supported.");

} else if (mac_addr.empty() && (hlen > 0) ) {
if (mac_addr.empty() && (hlen > 0) ) {
isc_throw(OutOfRange, "Invalid HW Address specified");
}

Expand Down

0 comments on commit 549afba

Please sign in to comment.