Skip to content

Commit 236fb18

Browse files
Incorporate the Relay Agent Information obtained from the request into the respective reply (#22)
https://www.rfc-editor.org/rfc/rfc3046.html#section-2.2
1 parent 49ab074 commit 236fb18

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dhcp4/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const (
5555
OptVendorIdentifier Option = 60 // string
5656
OptClientIdentifier Option = 61 // string
5757
OptFQDN Option = 81 // string
58+
OptAgentInformation Option = 82 // struct
5859

5960
// You shouldn't need to use the following directly. Instead,
6061
// refer to the fields in the Packet struct, and Marshal/Unmarshal

pixiecore/dhcp.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ func (s *Server) offerDHCP(pkt *dhcp4.Packet, mach Machine, serverIP net.IP, fwt
183183
resp.Options[97] = pkt.Options[97]
184184
}
185185

186+
// https://www.rfc-editor.org/rfc/rfc3046.html#section-2.2
187+
if pkt.Options[dhcp4.OptAgentInformation] != nil {
188+
resp.Options[dhcp4.OptAgentInformation] = pkt.Options[dhcp4.OptAgentInformation]
189+
}
190+
186191
switch fwtype {
187192
case FirmwareX86PC:
188193
// This is completely standard PXE: we tell the PXE client to

0 commit comments

Comments
 (0)