mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 17:43:14 +00:00
Setting PXEClient in option 60
This trigges the proxyDHCP sequence to follow up.
This commit is contained in:
parent
1c7c897267
commit
895216d94f
@ -379,13 +379,14 @@ def check_reply(node, info, packet, sock, cfg, reqview):
|
||||
repview[249:255] = b'\x33\x04\x00\x00\x00\xf0' # fixed short lease time
|
||||
repview[255:257] = b'\x61\x11'
|
||||
repview[257:274] = packet[97]
|
||||
repview[274] = 0xff # end of options, should always be last byte
|
||||
repview[274:285] = b'\x3c\x09PXEClient'
|
||||
repview[285] = 0xff # end of options, should always be last byte
|
||||
repview = memoryview(reply)
|
||||
pktlen = struct.pack('!H', 275 + 28) # ip+udp = 28
|
||||
pktlen = struct.pack('!H', 286 + 28) # ip+udp = 28
|
||||
repview[2:4] = pktlen
|
||||
curripsum = ~(_ipsum(constiphdrsum + pktlen + myipn)) & 0xffff
|
||||
repview[10:12] = struct.pack('!H', curripsum)
|
||||
repview[24:26] = struct.pack('!H', 275 + 8)
|
||||
repview[24:26] = struct.pack('!H', 286 + 8)
|
||||
datasum = _ipsum(bytes(repview[12:]) + b'\x00\x11' + bytes(
|
||||
repview[24:26]))
|
||||
datasum = ~datasum & 0xffff
|
||||
@ -401,7 +402,7 @@ def check_reply(node, info, packet, sock, cfg, reqview):
|
||||
targ.sll_protocol = socket.htons(0x800)
|
||||
targ.sll_ifindex = info['netinfo']['ifidx']
|
||||
pkt = ctypes.byref((ctypes.c_char * 284).from_buffer(repview))
|
||||
sendto(tsock.fileno(), pkt, 275 + 28, 0, ctypes.byref(targ),
|
||||
sendto(tsock.fileno(), pkt, 286 + 28, 0, ctypes.byref(targ),
|
||||
ctypes.sizeof(targ))
|
||||
print('Thinking about reply to {0}'.format(node))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user