Added a const value for the buffer size.
Used that value for both the initial buffer allocation, and the buffer re-initialization in preparation for sending packets.
This prevents a buffer overflow when building the DHCPREQUEST packet because the buffer appears to have shrunk while processing the DHCPOFFER reply.
Running my eyes over it, I can see no reason at all for _BUFF to be global. And indeed, this is a copy-book example of why globals are bad, because code in function A modifies the global, causing a bug in function B.
Added a const value for the buffer size. Used that value for both the initial buffer allocation, and the buffer re-initialization in preparation for sending packets.
This prevents a buffer overflow when building the DHCPREQUEST packet because the buffer appears to have shrunk while processing the DHCPOFFER reply.