]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4495] Fixed inefficient creation of DHCP Message Type option.
authorMarcin Siodelski <marcin@isc.org>
Tue, 17 May 2016 15:34:48 +0000 (17:34 +0200)
committerMarcin Siodelski <marcin@isc.org>
Tue, 17 May 2016 15:35:56 +0000 (17:35 +0200)
src/lib/dhcp/pkt4.cc

index 3c980b520548a9aca2cb9ac1e97f9b0acb232940..bbd3e687638d03ac275b1a97228b123ffdd932e8 100644 (file)
@@ -276,9 +276,8 @@ void Pkt4::setType(uint8_t dhcp_type) {
         }
     } else {
         // There is no message type option yet, add it
-        std::vector<uint8_t> tmp(1, dhcp_type);
-        opt = OptionPtr(new OptionInt<uint8_t>(Option::V4, DHO_DHCP_MESSAGE_TYPE,
-                                               tmp.begin(), tmp.end()));
+        opt.reset(new OptionInt<uint8_t>(Option::V4, DHO_DHCP_MESSAGE_TYPE,
+                                         dhcp_type));
         addOption(opt);
     }
 }