[syslinux:master] core/pxe/dhcp_option: Filter options based on pkt_type
syslinux-bot for Gene Cumm
gene.cumm at gmail.com
Thu Jun 25 18:18:04 PDT 2015
Commit-ID: 6e958ddff25c1df2a11e8c72b8b1e20bd671e3fe
Gitweb: http://www.syslinux.org/commit/6e958ddff25c1df2a11e8c72b8b1e20bd671e3fe
Author: Gene Cumm <gene.cumm at gmail.com>
AuthorDate: Thu, 25 Jun 2015 11:13:07 -0400
Committer: Gene Cumm <gene.cumm at gmail.com>
CommitDate: Thu, 25 Jun 2015 11:13:07 -0400
core/pxe/dhcp_option: Filter options based on pkt_type
Filter (by setting a minimum option number) the options based on pkt_type.
DHCPDiscover/PXEReply should only contain info about client ID, boot
server and PXELINUX options.
Signed-off-by: Gene Cumm <gene.cumm at gmail.com>
---
core/fs/pxe/dhcp_option.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/core/fs/pxe/dhcp_option.c b/core/fs/pxe/dhcp_option.c
index 0835cfe..8d93a6a 100644
--- a/core/fs/pxe/dhcp_option.c
+++ b/core/fs/pxe/dhcp_option.c
@@ -228,11 +228,14 @@ void parse_dhcp(const void *pkt, size_t pkt_len, int pkt_type)
{
const struct bootp_t *dhcp = (const struct bootp_t *)pkt;
int opt_len;
+ int min_opt = 0;
IPInfo.ipver = 4; /* This is IPv4 only for now... */
over_load = 0;
- if ((pkt_type == 0 || pkt_type == 2) && ip_ok(dhcp->yip))
+ if (pkt_type == 1 || pkt_type == 3)
+ min_opt = 43;
+ if ((pkt_type == 2) && ip_ok(dhcp->yip))
IPInfo.myip = dhcp->yip;
if (ip_ok(dhcp->sip))
More information about the Syslinux-commits
mailing list