[PATCH] dhcp: put option 53 at the beginning
... unless it is listed in 55.
Many clients expect option 53 at the beginning.
mTCP has this code:
if ( resp->options[0] != 53 ) {
TRACE_WARN(( "Dhcp: first option was not a Dhcp msg type\n" ));
return;
}
wattcp32 has this:
static int DHCP_is_ack (void)
{
const BYTE *opt = (const BYTE*) &dhcp_in.dh_opt[4];
return (opt[0] == DHCP_OPT_MSG_TYPE && opt[1] == 1 && opt[2] == DHCP_ACK);
}
static int DHCP_is_nack (void)
{
const BYTE *opt = (const BYTE*) &dhcp_in.dh_opt[4];
return (opt[0] == DHCP_OPT_MSG_TYPE && opt[1] == 1 && opt[2] == DHCP_NAK);
}
Link: https://bugs.passt.top/show_bug.cgi?id=77
Signed-off-by: Stas Sergeev
On Tue, 3 Oct 2023 13:01:22 +0500
Stas Sergeev
... unless it is listed in 55. Many clients expect option 53 at the beginning. mTCP has this code: if ( resp->options[0] != 53 ) { TRACE_WARN(( "Dhcp: first option was not a Dhcp msg type\n" )); return; }
wattcp32 has this: static int DHCP_is_ack (void) { const BYTE *opt = (const BYTE*) &dhcp_in.dh_opt[4];
return (opt[0] == DHCP_OPT_MSG_TYPE && opt[1] == 1 && opt[2] == DHCP_ACK); } static int DHCP_is_nack (void) { const BYTE *opt = (const BYTE*) &dhcp_in.dh_opt[4];
return (opt[0] == DHCP_OPT_MSG_TYPE && opt[1] == 1 && opt[2] == DHCP_NAK); }
Link: https://bugs.passt.top/show_bug.cgi?id=77 Signed-off-by: Stas Sergeev
Applied, thanks! -- Stefano
participants (2)
-
Stas Sergeev
-
Stefano Brivio