From: Marcin Siodelski Date: Fri, 11 Dec 2015 15:11:26 +0000 (+0100) Subject: [4206b] Minor updates to the Pkt4::getLabel method. X-Git-Tag: trac4240_base~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a158b3d5f2c5306e951c80f56cbfbb22115e1edf;p=thirdparty%2Fkea.git [4206b] Minor updates to the Pkt4::getLabel method. The warning about malformed client-id is separated by a single space character from the actual label. Also, used stream object to concatenate label with suffix to be consistent with the convention used in makeLabel. --- diff --git a/src/lib/dhcp/pkt4.cc b/src/lib/dhcp/pkt4.cc index 309764220f..71086e23ff 100644 --- a/src/lib/dhcp/pkt4.cc +++ b/src/lib/dhcp/pkt4.cc @@ -352,20 +352,22 @@ Pkt4::getLabel() const { client_id = ClientIdPtr(new ClientId(client_opt->getData())); } catch (...) { // ClientId may throw if the client-id is too short. - suffix = "(malformed client-id)"; + suffix = " (malformed client-id)"; } } - std::string txt; + std::ostringstream label; try { - txt = makeLabel(hwaddr_, client_id, transid_); + label << makeLabel(hwaddr_, client_id, transid_); } catch (...) { // This should not happen with the current code, but we may add extra // sanity checks in the future that would possibly throw if // the hwaddr lenght is 0. - txt = "(malformed hw address)"; + label << " (malformed hw address)"; } - return (txt + suffix); + + label << suffix; + return (label.str()); } std::string