aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2015-06-25 11:13:07 -0400
committerGene Cumm <gene.cumm@gmail.com>2015-06-25 11:13:07 -0400
commit6e958ddff25c1df2a11e8c72b8b1e20bd671e3fe (patch)
treeccf84f6fa2434a8b3a2c83ae096d09a17974eeb8 /core
parent8e53b8a63c8ae1e266f63f502a537b9e8e03baed (diff)
downloadsyslinux-6e958ddff25c1df2a11e8c72b8b1e20bd671e3fe.tar.gz
syslinux-6e958ddff25c1df2a11e8c72b8b1e20bd671e3fe.tar.xz
syslinux-6e958ddff25c1df2a11e8c72b8b1e20bd671e3fe.zip
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@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/fs/pxe/dhcp_option.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/fs/pxe/dhcp_option.c b/core/fs/pxe/dhcp_option.c
index 0835cfee..8d93a6af 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))