From: Francis Dupont Date: Mon, 25 Apr 2016 14:36:10 +0000 (+0200) Subject: [4268a] Padded hlen/htype pkt4 X-Git-Tag: trac4106_update_base~41^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc80ce57a5af00ec5a9eaa8e11acdacbafa9f36e;p=thirdparty%2Fkea.git [4268a] Padded hlen/htype pkt4 --- diff --git a/src/lib/eval/token.cc b/src/lib/eval/token.cc index 095fd52380..7745a3da06 100644 --- a/src/lib/eval/token.cc +++ b/src/lib/eval/token.cc @@ -163,11 +163,19 @@ TokenPkt4::evaluate(const Pkt& pkt, ValueStack& values) { break; case HLEN: - binary.assign(1, pkt4.getHlen()); + // Pad the uint8_t field to 4 bytes. + binary.push_back(0); + binary.push_back(0); + binary.push_back(0); + binary.push_back(pkt4.getHlen()); break; case HTYPE: - binary.assign(1, pkt4.getHtype()); + // Pad the uint8_t field to 4 bytes. + binary.push_back(0); + binary.push_back(0); + binary.push_back(0); + binary.push_back(pkt4.getHtype()); break; default: diff --git a/src/lib/eval/token.h b/src/lib/eval/token.h index b3c4cedd62..1df143fe35 100644 --- a/src/lib/eval/token.h +++ b/src/lib/eval/token.h @@ -299,8 +299,8 @@ protected: /// - ciaddr (client IP address, 4 octets) /// - yiaddr ('your' (client) IP address, 4 octets) /// - siaddr (next server IP address, 4 octets) -/// - hlen (hardware address length, 1 octet) -/// - htype (hardware address type, 1 octet) +/// - hlen (hardware address length, padded to 4 octets) +/// - htype (hardware address type, padded to 4 octets) class TokenPkt4 : public Token { public: