On Tue, Feb 11, 2025 at 12:14:34PM +0100, Enrique Llorente wrote:
The option 255 (end of options) do not need the length byte, this change remove that allowing to have one extra byte at other dynamic options.
Signed-off-by: Enrique Llorente
Thanks, change is good. However, could you also update the comment on OPT_MAX's definition that appears to have the same error in it.
--- dhcp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dhcp.c b/dhcp.c index 401cb5b..3aef13f 100644 --- a/dhcp.c +++ b/dhcp.c @@ -127,7 +127,7 @@ struct msg { uint8_t sname[64]; uint8_t file[128]; uint32_t magic; - uint8_t o[OPT_MAX + 2 /* End option and its length */ ]; + uint8_t o[OPT_MAX + 1 /* End option */ ]; } __attribute__((__packed__));
/** @@ -194,7 +194,6 @@ static int fill(struct msg *m) }
m->o[offset++] = 255; - m->o[offset++] = 0;
if (offset < OPT_MIN) { memset(&m->o[offset], 0, OPT_MIN - offset);
-- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson