diff options
author | Sean Karlage <skarlage@fb.com> | 2018-03-03 15:32:25 -0800 |
---|---|---|
committer | Sean Karlage <skarlage@fb.com> | 2018-03-03 15:32:25 -0800 |
commit | 6cfb183f6e3c8496a80aad03b8f47423eeac1123 (patch) | |
tree | a5cb53df2282d081c72522d64b30764da488cf71 /dhcpv4 | |
parent | a22cefc86285b6ba1d9879486fda11054d070b78 (diff) |
Fix issue where server would not process the INFORM[SELECT] as a select packet. Also add some undocumented options that seem to be used (shadow mounts, machine name).
Diffstat (limited to 'dhcpv4')
-rw-r--r-- | dhcpv4/bsdp.go | 25 | ||||
-rw-r--r-- | dhcpv4/types.go | 3 |
2 files changed, 26 insertions, 2 deletions
diff --git a/dhcpv4/bsdp.go b/dhcpv4/bsdp.go index 05542be..4096ce6 100644 --- a/dhcpv4/bsdp.go +++ b/dhcpv4/bsdp.go @@ -25,9 +25,12 @@ const ( BSDPOptionBootImageList BSDPOptionNetboot1_0Firmware BSDPOptionBootImageAttributesFilterList + BSDPOptionShadowMountPath OptionCode = 128 + BSDPOptionShadowFilePath OptionCode = 129 + BSDPOptionMachineName OptionCode = 130 ) -// Versions (seen so far) +// Versions var ( BSDPVersion1_0 = []byte{1, 0} BSDPVersion1_1 = []byte{1, 1} @@ -280,7 +283,7 @@ func InformSelectForAck(ack DHCPv4, replyPort uint16, selectedImage BootImage) ( }, Option{ Code: BSDPOptionSelectedBootImageID, - Data: append([]byte{4}, selectedImage.ID.toBytes()...), + Data: selectedImage.ID.toBytes(), }, } @@ -315,6 +318,24 @@ func InformSelectForAck(ack DHCPv4, replyPort uint16, selectedImage BootImage) ( }) } + vendorClassID, err := makeVendorClassIdentifier() + if err != nil { + return nil, err + } + d.AddOption(Option{ + Code: OptionClassIdentifier, + Data: []byte(vendorClassID), + }) + d.AddOption(Option{ + Code: OptionParameterRequestList, + Data: []byte{ + OptionSubnetMask, + OptionRouter, + OptionBootfileName, + OptionVendorSpecificInformation, + OptionClassIdentifier, + }, + }) d.AddOption(Option{ Code: OptionDHCPMessageType, Data: []byte{MessageTypeInform}, diff --git a/dhcpv4/types.go b/dhcpv4/types.go index f840609..4f3ad0f 100644 --- a/dhcpv4/types.go +++ b/dhcpv4/types.go @@ -374,4 +374,7 @@ var BSDPOptionCodeToString = map[OptionCode]string{ BSDPOptionBootImageList: "BSDP Boot Image List", BSDPOptionNetboot1_0Firmware: "BSDP Netboot 1.0 Firmware", BSDPOptionBootImageAttributesFilterList: "BSDP Boot Image Attributes Filter List", + BSDPOptionShadowMountPath: "BSDP Shadow Mount Path", + BSDPOptionShadowFilePath: "BSDP Shadow File Path", + BSDPOptionMachineName: "BSDP Machine Name", } |