Send dhcp-users mailing list submissions to
[email protected]
Advertising
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."
Today's Topics:
1. Re: invalid expression type in print_expression: 45 (Bob Harold)
2. Re: some problems with classes (Simon Hobson)
3. Re: invalid expression type in print_expression: 45
(Glenn Satchell)
4. Re: some problems with classes (Glenn Satchell)
5. Re: invalid expression type in print_expression: 45
(Shraddha Pandhe)
----------------------------------------------------------------------
Message: 1
Date: Wed, 4 Nov 2015 08:42:28 -0500
From: Bob Harold <[email protected]>
To: Users of ISC DHCP <[email protected]>
Subject: Re: invalid expression type in print_expression: 45
Message-ID:
<ca+nkc8dl3os-qapzhjn1z5g9uwfo6wztydmahkgsktfrdxu...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Mon, Nov 2, 2015 at 6:45 PM, Shraddha Pandhe <[email protected]
> wrote:
> Hi folks,
>
> I am using dhcp-4.1.1-49.
>
> What are the possible reasons for getting this error? I have been using
> the same dhcpd.conf without any issues. Today, I removed "dhcp-domain"
> option from the subnet definition and I started seeing this issue. Adding
> dhcp-domain back didn't help, so I am not sure if that caused anything.
>
>
>
> My dhcpd config file:
>
>
> # dhcpd.conf
> #
> # Sample configuration file for ISC dhcpd
> #
> log-facility local6;
> allow booting;
> deny unknown-clients;
> ddns-update-style none;
> default-lease-time 3600;
>
> lease-file-name "/home/neutron/dhcpd/dhcpd.leases";
> pid-file-name "/home/neutron/dhcpd/pid";
>
> next-server <ip-address>;
> server-name "<ip-address>";
>
> omapi-port 7911;
>
> # Local subnet definition is required to start dhcpd
> subnet <ip-address> netmask 255.255.255.255 {
> }
>
>
> if exists user-class and option user-class = "iPXE" {
> filename "init.ipxe";
> }
> elsif exists user-class and option user-class = "gPXE" {
> filename "init.gpxe";
> }
> else {
> filename "undionly.kpxe";
> }
>
> ####################################################################
> # DHCP Subnet Definitions to follow #
> ####################################################################
> # NETWORK_ID 0b00f86d-2dbd-4931-8a17-8ddaea74f475
> subnet 192.168.122.0 netmask 255.255.255.0 {
> option broadcast-address 192.168.122.255;
> option domain-name-servers 192.168.122.1;
> range 192.168.122.2 192.168.122.254;
> }
>
> Guessing here, but worth a try.
The "45" in the error message is probably the line number, but that would
be the very end of your file, from what I see. One possibility is that
there is an invisible control character somewhere in the file, or some
punctuation is unicode instead of ascii.
By any chance did you copy/paste from a work processor? They often use
different quote and hyphen characters that look similar but are not the
right character.
On Linux or Unix, try this:
cat -v /etc/dhcpd.conf > /tmp/dhcpd.conf
diff /etc/dhcpd.conf /tmp/dhcpd.conf
If there are any differences, delete and retype that line (do not
copy/paste).
Or
Open in a plain text editor like Notepad on Windows or gedit on Linux and
then save as a new file, and try the new file.
Or
Open in "vi" or "vim" and look for control characters - should show as "^"
followed by some character, but you won't be able to search for the "^".
--
Bob Harold
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://lists.isc.org/pipermail/dhcp-users/attachments/20151104/d7b99303/attachment-0001.html>
------------------------------
Message: 2
Date: Wed, 4 Nov 2015 14:03:47 +0000
From: Simon Hobson <[email protected]>
To: Users of ISC DHCP <[email protected]>
Subject: Re: some problems with classes
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Andreas Burger <[email protected]> wrote:
> allow mebers of "agrl";
> deny unknown clients;
That's probably the problem. I can't remember the exact logic, but allow and
deny in combination don't work as you might expect. Either use only "allow" in
which case anything not specifically allowed is denied, or use only "deny" in
which case anything not specifically denied is allowed.
Ah, a quick search came up with this message from the archives :
https://lists.isc.org/pipermail/dhcp-users/2008-January/005273.html
> I _always_ have to check the code.
>
> if ((uid_lease -> pool -> prohibit_list &&
> permitted (packet, uid_lease -> pool -> prohibit_list)) ||
> (uid_lease -> pool -> permit_list &&
> !permitted (packet, uid_lease -> pool -> permit_list))) {
>
> log_info ("not permitted: %s",
> ...
> }
>
> It's not intuitive...permit and deny lists don't go onto one ACL with
> preservation of order of operations like normal people expect.
I don't know enough about the language (I don't even recognise the syntax of
some of it) to reliably determine exactly what it's doing from that.
I *think* it's doing something like :
If there is a deny list, and the client matches any statement in it
OR there's an allow list, and the client doesn't match any element in it
THEN deny the client
ELSE permit the client (fall through to the following code)
Had to double check in "the book"*, "known" means the client has a host
declaration. So actually I think in your case the combination ought to work :
There is a deny list, but because the client is known then it doesn't match
else: There is an allow list, but the client matches it
therefore: the client should be allowed access to the pool.
* The DHCP Handbook by Ralph Droms and Ted Lemon
------------------------------
Message: 3
Date: Thu, 5 Nov 2015 01:06:41 +1100
From: "Glenn Satchell" <[email protected]>
To: "Users of ISC DHCP" <[email protected]>
Subject: Re: invalid expression type in print_expression: 45
Message-ID:
<[email protected]>
Content-Type: text/plain;charset=iso-8859-1
On Thu, November 5, 2015 12:42 am, Bob Harold wrote:
> On Mon, Nov 2, 2015 at 6:45 PM, Shraddha Pandhe
> <[email protected]
>> wrote:
>
>> Hi folks,
>>
>> I am using dhcp-4.1.1-49.
>>
>> What are the possible reasons for getting this error? I have been using
>> the same dhcpd.conf without any issues. Today, I removed "dhcp-domain"
>> option from the subnet definition and I started seeing this issue.
>> Adding
>> dhcp-domain back didn't help, so I am not sure if that caused anything.
>>
>>
>>
>> My dhcpd config file:
>>
>>
>> # dhcpd.conf
>> #
>> # Sample configuration file for ISC dhcpd
>> #
>> log-facility local6;
>> allow booting;
>> deny unknown-clients;
>> ddns-update-style none;
>> default-lease-time 3600;
>>
>> lease-file-name "/home/neutron/dhcpd/dhcpd.leases";
>> pid-file-name "/home/neutron/dhcpd/pid";
>>
>> next-server <ip-address>;
>> server-name "<ip-address>";
>>
>> omapi-port 7911;
>>
>> # Local subnet definition is required to start dhcpd
>> subnet <ip-address> netmask 255.255.255.255 {
>> }
>>
>>
>> if exists user-class and option user-class = "iPXE" {
>> filename "init.ipxe";
>> }
>> elsif exists user-class and option user-class = "gPXE" {
>> filename "init.gpxe";
>> }
>> else {
>> filename "undionly.kpxe";
>> }
>>
>> ####################################################################
>> # DHCP Subnet Definitions to follow #
>> ####################################################################
>> # NETWORK_ID 0b00f86d-2dbd-4931-8a17-8ddaea74f475
>> subnet 192.168.122.0 netmask 255.255.255.0 {
>> option broadcast-address 192.168.122.255;
>> option domain-name-servers 192.168.122.1;
>> range 192.168.122.2 192.168.122.254;
>> }
>>
Here is the line in the source, ./common/tree.c - it is evaluating an
expression and the 45 is the "operation". Looking in includes/tree.c,
operator 46 is expr_funcall (whatever that means)
int write_expression (file, expr, col, indent, firstp)
...
switch (expr -> op) {
...
default:
log_fatal ("invalid expression type in print_expression: %d",
expr -> op);
}
return col;
}
I have a pretty early copy of the 4.1.1 source, but when I compare with
4.3.2 source there is a case expr_funcall in that switch statement now. Is
it possible you used a late version that has written something the older
version can now no longer parse? Is it possible to upgrade to the newest
release you can (ie later 4.1.1 or perhaps compile your own latest
version?
My guess is that it has written something to the leases file, and now
can't evaluate it properly. So that's where I'd look.
regards,
-glenn
------------------------------
Message: 4
Date: Thu, 5 Nov 2015 01:18:46 +1100
From: "Glenn Satchell" <[email protected]>
To: "Users of ISC DHCP" <[email protected]>
Subject: Re: some problems with classes
Message-ID:
<[email protected]>
Content-Type: text/plain;charset=iso-8859-1
On Thu, November 5, 2015 1:03 am, Simon Hobson wrote:
> Andreas Burger <[email protected]> wrote:
>
>> allow mebers of "agrl";
>> deny unknown clients;
>
> That's probably the problem. I can't remember the exact logic, but allow
> and deny in combination don't work as you might expect. Either use only
> "allow" in which case anything not specifically allowed is denied, or use
> only "deny" in which case anything not specifically denied is allowed.
>
> Ah, a quick search came up with this message from the archives :
> https://lists.isc.org/pipermail/dhcp-users/2008-January/005273.html
>
>> I _always_ have to check the code.
>>
>> if ((uid_lease -> pool -> prohibit_list &&
>> permitted (packet, uid_lease -> pool -> prohibit_list)) ||
>> (uid_lease -> pool -> permit_list &&
>> !permitted (packet, uid_lease -> pool -> permit_list))) {
>>
>> log_info ("not permitted: %s",
>> ...
>> }
>>
>> It's not intuitive...permit and deny lists don't go onto one ACL with
>> preservation of order of operations like normal people expect.
>
> I don't know enough about the language (I don't even recognise the syntax
> of some of it) to reliably determine exactly what it's doing from that.
> I *think* it's doing something like :
> If there is a deny list, and the client matches any statement in it
> OR there's an allow list, and the client doesn't match any element in it
> THEN deny the client
> ELSE permit the client (fall through to the following code)
>
> Had to double check in "the book"*, "known" means the client has a host
> declaration. So actually I think in your case the combination ought to
> work :
> There is a deny list, but because the client is known then it doesn't
> match
> else: There is an allow list, but the client matches it
> therefore: the client should be allowed access to the pool.
>
>
> * The DHCP Handbook by Ralph Droms and Ted Lemon
>
> _______________________________________________
> dhcp-users mailing list
> [email protected]
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
According to the man page it's "unknown-clients" with a dash in there.
There is also the inverse "known-clients", so reversing the logic to give
you two "allows" might behave as you expect:
allow members of "agrl";
allow known-clients;
regards,
-glenn
------------------------------
Message: 5
Date: Wed, 4 Nov 2015 13:01:06 -0800
From: Shraddha Pandhe <[email protected]>
To: Users of ISC DHCP <[email protected]>
Subject: Re: invalid expression type in print_expression: 45
Message-ID:
<cagwnvr5hmoc0q5adenxd-kkvutgvq_8fnvid3x8xgvb6wtp...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi,
Thanks Bob and Glenn for the pointers. I had wrong configuration in the
leases file. I removed it and it worked fine.
On Wed, Nov 4, 2015 at 6:06 AM, Glenn Satchell <[email protected]>
wrote:
> On Thu, November 5, 2015 12:42 am, Bob Harold wrote:
> > On Mon, Nov 2, 2015 at 6:45 PM, Shraddha Pandhe
> > <[email protected]
> >> wrote:
> >
> >> Hi folks,
> >>
> >> I am using dhcp-4.1.1-49.
> >>
> >> What are the possible reasons for getting this error? I have been using
> >> the same dhcpd.conf without any issues. Today, I removed "dhcp-domain"
> >> option from the subnet definition and I started seeing this issue.
> >> Adding
> >> dhcp-domain back didn't help, so I am not sure if that caused anything.
> >>
> >>
> >>
> >> My dhcpd config file:
> >>
> >>
> >> # dhcpd.conf
> >> #
> >> # Sample configuration file for ISC dhcpd
> >> #
> >> log-facility local6;
> >> allow booting;
> >> deny unknown-clients;
> >> ddns-update-style none;
> >> default-lease-time 3600;
> >>
> >> lease-file-name "/home/neutron/dhcpd/dhcpd.leases";
> >> pid-file-name "/home/neutron/dhcpd/pid";
> >>
> >> next-server <ip-address>;
> >> server-name "<ip-address>";
> >>
> >> omapi-port 7911;
> >>
> >> # Local subnet definition is required to start dhcpd
> >> subnet <ip-address> netmask 255.255.255.255 {
> >> }
> >>
> >>
> >> if exists user-class and option user-class = "iPXE" {
> >> filename "init.ipxe";
> >> }
> >> elsif exists user-class and option user-class = "gPXE" {
> >> filename "init.gpxe";
> >> }
> >> else {
> >> filename "undionly.kpxe";
> >> }
> >>
> >> ####################################################################
> >> # DHCP Subnet Definitions to follow #
> >> ####################################################################
> >> # NETWORK_ID 0b00f86d-2dbd-4931-8a17-8ddaea74f475
> >> subnet 192.168.122.0 netmask 255.255.255.0 {
> >> option broadcast-address 192.168.122.255;
> >> option domain-name-servers 192.168.122.1;
> >> range 192.168.122.2 192.168.122.254;
> >> }
> >>
>
> Here is the line in the source, ./common/tree.c - it is evaluating an
> expression and the 45 is the "operation". Looking in includes/tree.c,
> operator 46 is expr_funcall (whatever that means)
>
> int write_expression (file, expr, col, indent, firstp)
> ...
> switch (expr -> op) {
> ...
> default:
> log_fatal ("invalid expression type in print_expression:
> %d",
> expr -> op);
> }
> return col;
> }
>
> I have a pretty early copy of the 4.1.1 source, but when I compare with
> 4.3.2 source there is a case expr_funcall in that switch statement now. Is
> it possible you used a late version that has written something the older
> version can now no longer parse? Is it possible to upgrade to the newest
> release you can (ie later 4.1.1 or perhaps compile your own latest
> version?
>
> My guess is that it has written something to the leases file, and now
> can't evaluate it properly. So that's where I'd look.
>
> regards,
> -glenn
>
>
> _______________________________________________
> dhcp-users mailing list
> [email protected]
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://lists.isc.org/pipermail/dhcp-users/attachments/20151104/2dda12fb/attachment.html>
------------------------------
_______________________________________________
dhcp-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/dhcp-users
End of dhcp-users Digest, Vol 85, Issue 3
*****************************************