From 67ff2b503590a499173ae3a5fc29632d4185f100 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Wed, 17 Jan 2018 20:52:28 +0100 Subject: [PATCH] [5390] Allow empty MAC in setMac --- src/lib/dhcp/iface_mgr.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc index 92f90e9796..b0e872cf98 100644 --- a/src/lib/dhcp/iface_mgr.cc +++ b/src/lib/dhcp/iface_mgr.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -134,7 +134,9 @@ void Iface::setMac(const uint8_t* mac, size_t len) { << MAX_MAC_LEN); } mac_len_ = len; - memcpy(mac_, mac, len); + if (len > 0) { + memcpy(mac_, mac, len); + } } bool Iface::delAddress(const isc::asiolink::IOAddress& addr) { -- 2.47.2