Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-ISC-DHCPd CPAN distribution.

Report information
The Basics
Id: 60044
Status: resolved
Priority: 0/
Queue: Net-ISC-DHCPd

People
Owner: JHTHORSEN [...] cpan.org
Requestors: nikolay.a.petrov [...] intel.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.0802
Fixed in: 0.16



Subject: Parser stops in some conditions
System: Net-ISC-DHCPd v. 0.07 perl, v5.8.8 built for i386-linux-thread-multi Red Hat Enterprise Linux Server release 5.2 (Tikanga) i686 Parser stops then foud in root config file: "option space PXE;". Main point is "option space". Also parser stops in includes file then find "}" symbol if brakets wasn't open with "host {" statement. It fails with standalone "}" or in if constructions.
From: nikolay.a.petrov [...] intel.com
Втр Авг 03 11:32:49 2010, napetrov писал: Show quoted text
> System: > Net-ISC-DHCPd v. 0.0802 > perl, v5.8.8 built for i386-linux-thread-multi > Red Hat Enterprise Linux Server release 5.2 (Tikanga) i686 > > Parser stops then foud in root config file: "option space PXE;". Main > point is "option space". > > > > Also parser stops in includes file then find "}" symbol if brakets > wasn't open with "host {" statement. It fails with standalone "}" or in > if constructions.
Can you send me a test case? The actual config file (with as little as possible config) would be good input. Or if you could also clone the project on github and commit a failing test, that would be excellent!
From: nikolay.a.petrov [...] intel.com
Yes, sure. I include two modified config files.
Subject: dhcpd.conf
Download dhcpd.conf
application/octet-stream 1.1k

Message body not shown because it is not plain text.

Subject: foo-included.conf
Download foo-included.conf
application/octet-stream 248b

Message body not shown because it is not plain text.

Hi, First of all: Sorry for completely forgetting about this bug! Second: I got a working branch @github - I think. Could you have a look and see if it looks sensible? This is the test, which is OK now. You can see in the bottom that the parser now understands if/elsif/else as well as optionspaces. (without encapsulation) https://github.com/jhthorsen/net-isc-dhcpd/blob/rt-60044-with-conditions/t/90-60044-parse.t Solution: For every Config:: class you have, there is also generated a ::Condition class. Example: Config::Condition Config::Subnet::Condition Config::Host::Condition This "config" class does the ConditionRole role, which has "type" and "logic" attributes. Each of these condition classes can have the same children as the "parent" Config class (meaning Config::Subnet::Condition has the same children as Config::Subnet) Conditions are not grouped. They are in series, like any other config node. This means that you need to investigate, if you want to find if+elsif+else, and do logic based on that group. What do you think?
Also, do you know which blocks that support conditions? I'm thinking about these classes now: Net/ISC/DHCPd/Config.pm Net/ISC/DHCPd/Config/Group.pm Net/ISC/DHCPd/Config/Host.pm Net/ISC/DHCPd/Config/Include.pm Net/ISC/DHCPd/Config/Pool.pm Net/ISC/DHCPd/Config/Subnet.pm Config.pm and Include.pm is given from your bug-report, but I'm not sure about the rest.
On Wed Jan 05 02:23:04 2011, JHTHORSEN wrote: Show quoted text
> Also, do you know which blocks that support conditions? I'm thinking > about these classes now: > > Net/ISC/DHCPd/Config.pm > Net/ISC/DHCPd/Config/Group.pm > Net/ISC/DHCPd/Config/Host.pm > Net/ISC/DHCPd/Config/Include.pm > Net/ISC/DHCPd/Config/Pool.pm > Net/ISC/DHCPd/Config/Subnet.pm > > Config.pm and Include.pm is given from your bug-report, but I'm not sure > about the rest.
Conditionals have been added in 0.16.