Commit bc80ce57 authored by Francis Dupont's avatar Francis Dupont

[4268a] Padded hlen/htype pkt4

parent 18542d6e
......@@ -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:
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment