From 1bbe5b67149930e43859df86fbf5325a6abe8fa8 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Thu, 15 Oct 2015 14:44:51 +0200 Subject: [PATCH] [4058] Moved client-id option copy --- src/bin/dhcp4/dhcp4_srv.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 8547fe85dc..066a17699a 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -186,14 +186,6 @@ Dhcpv4Exchange::copyDefaultFields() { // relay address resp_->setGiaddr(query_->getGiaddr()); - // Let's copy client-id to response. See RFC6842. - // It is possible to disable RFC6842 to keep backward compatibility - bool echo = CfgMgr::instance().echoClientId(); - OptionPtr client_id = query_->getOption(DHO_DHCP_CLIENT_IDENTIFIER); - if (client_id && echo) { - resp_->addOption(client_id); - } - // If src/dest HW addresses are used by the packet filtering class // we need to copy them as well. There is a need to check that the // address being set is not-NULL because an attempt to set the NULL @@ -213,6 +205,14 @@ Dhcpv4Exchange::copyDefaultFields() { void Dhcpv4Exchange::copyDefaultOptions() { + // Let's copy client-id to response. See RFC6842. + // It is possible to disable RFC6842 to keep backward compatibility + bool echo = CfgMgr::instance().echoClientId(); + OptionPtr client_id = query_->getOption(DHO_DHCP_CLIENT_IDENTIFIER); + if (client_id && echo) { + resp_->addOption(client_id); + } + // If this packet is relayed, we want to copy Relay Agent Info option OptionPtr rai = query_->getOption(DHO_DHCP_AGENT_OPTIONS); if (rai) { -- 2.47.2