diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-04-26 14:15:55 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-04-26 14:23:50 +0200 |
commit | 09e5eca32c1872c1676c25dfd3f240b10bc85d55 (patch) | |
tree | 23a5b9cdd19e8cfa71e13f47e695add0a5ec4356 /src/dhcpv4.h | |
parent | 3cd48765b74e498f06397f4b90b64cafe3a82dd1 (diff) |
dhcpv4: fix DHCP packet size
Calculate the DHCP packet size based on the number of DHCP options in the
message. Make sure the DHCP packet size does not go lower than 300 bytes
as some clients ignore DHCP messages smaller than 300 bytes.
Based on a patch by Dainis Jonitis <dainis.jonitis@ubnt.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv4.h')
-rw-r--r-- | src/dhcpv4.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dhcpv4.h b/src/dhcpv4.h index 96bd068..505346f 100644 --- a/src/dhcpv4.h +++ b/src/dhcpv4.h @@ -19,6 +19,8 @@ #define DHCPV4_FLAG_BROADCAST 0x8000 +#define DHCPV4_MIN_PACKET_SIZE 300 + enum dhcpv4_op { DHCPV4_BOOTREQUEST = 1, DHCPV4_BOOTREPLY = 2 @@ -37,6 +39,7 @@ enum dhcpv4_msg { }; enum dhcpv4_opt { + DHCPV4_OPT_PAD = 0, DHCPV4_OPT_NETMASK = 1, DHCPV4_OPT_ROUTER = 3, DHCPV4_OPT_DNSSERVER = 6, |