Implicitly add DHCP option 53 when marshalling.

This commit is contained in:
David Anderson 2016-02-28 01:06:37 -08:00
parent af2fc8892a
commit 621a0c28e5

View File

@ -161,7 +161,11 @@ func (p *Packet) Marshal() ([]byte, error) {
ret.Write([]byte(p.HardwareAddr)) ret.Write([]byte(p.HardwareAddr))
ret.Write([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) ret.Write([]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
opts := p.Options opts := make(Options, len(p.Options)+1)
for k, v := range p.Options {
opts[k] = v
}
opts[53] = []byte{byte(p.Type)}
var err error var err error
if optsInSname { if optsInSname {
opts, err = opts.marshalLimited(ret, 64, true) opts, err = opts.marshalLimited(ret, 64, true)