<br><br><div class="gmail_quote">On Sun, Dec 16, 2012 at 6:04 PM, Peter Rathlev <span dir="ltr"><<a href="mailto:peter@rathlev.dk" target="_blank">peter@rathlev.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sun, 2012-12-16 at 16:09 +0100, Nico De Ranter wrote:<br>
> substring = substring fomr charcter x to character y (not y characters<br>
> long).  So substring( ... 2,7) is 6 bytes long, substring( ..., 5,5)<br>
> is 1 character long as expected.  I'm actually using the same<br>
> substrings in my log statement (not included below) and it prints<br>
> exactly the parts I want.<br>
<br>
</div>It's substring(string, offset, length). Take a look at man dhcp-eval to<br>
confirm. I only run dhcp-4.x but as far as I can see via Google it was<br>
the same in 3.1.1.<br></blockquote><div><br>strange, I had to increase the first substring from 6 to 7 otherwise the last character wouldn't match.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">><br>
> Why am I converting to ascii? Because that's what I found in an<br>
> example. I tried without converting but then I didn't seem to get a<br>
> match. :-).  I'm not so worried about performance as there will be<br>
> about 100 clients max anyway.<br>
<br>
</div>Not converting to ASCII means better performance but also that you don't<br>
have to worry about single or double digit bytes as Sten pointed out. It<br>
can work fine with the conversion though.<br>
<div class="im">><br>
> As you can see at the bottom of my initial mail I'm actually<br>
> reasonably sure the class definition is correct as I also have a log<br>
> statement (not included below) which logs a message when the right<br>
> client does a dhcp request. If a change anything in the class<br>
> definition or remove the 'allow ...' from the pool or if another<br>
> client tries to do dhcp it doesn't log.   So it seems the dhcp server<br>
> does properly match the client's option 82 info and MAC address, it<br>
> just doesn't seem to do anything with it.<br>
<br>
</div>What does syslog messages from dhcpd say? Does it log the DISCOVER?<br>
Maybe it says something about why it doesn't hand out a lease.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div>Yep, it does log the discover. But that's about all it logs<br><br>[Dec 16 21:52:22][info][mgt][dhcpd][-]:  Lease for 84:78:ac:84:e5:80 remote id e hardware 1:0:14:2d:40:f:15<br>
[Dec 16 21:52:22][info][mgt][dhcpd][-]:  DHCPDISCOVER from 00:14:2d:40:0f:15 via eth0: unknown client<br><br>The first line is my log statement.  If I change anything in the class so it doesn't match anymore I get something like this in stead (I only want to use static addresses)<br>
<br>[Dec 16 21:51:08][err][mgt][dhcpd][-]:  DHCPDISCOVER from 00:1b:21:28:7f:66 via eth0: network 10.103.0/24: no free leases<br><br>Nico<br> <br clear="all"></div></div><br>-- <br><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:rgb(128,128,128)">Nico De Ranter</span><div>
<p style="margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt"><font color="#808080">Operations Engineer</font></p><p style="margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt"><font color="#808080"><br>
</font></p><p style="margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt"><span><span><span style="color:gray" lang="EN-US">eSATURNUS</span></span></span><span style="color:gray" lang="EN-US"><span></span></span></p>
<p style="margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt"><span style="color:gray" lang="EN-US">T. <a value="+3216401282" style="color:rgb(0,0,204)">+32 16 40 12 82</a></span></p><p style="margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt">
<span style="color:gray" lang="EN-US">M. <a value="+32478567829" style="color:rgb(0,0,204)">+32 497 91 53 78<br></a></span></p><p style="margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt"><span style="color:rgb(102,102,102)"><a href="http://www.esaturnus.com" target="_blank">www.esaturnus.com</a></span></p>
<p style="margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt"><img src="https://www.google.com/a/esaturnus.com/images/logo.gif?alpha=1"><br><span style="color:gray" lang="EN-US"><a value="+32478567829" style="color:rgb(0,0,204)"></a></span></p>
<span style="color:gray"><a href="http://www.esaturnus.com/" style="color:rgb(0,0,204)" target="_blank"><span lang="EN-US"></span></a></span><span style="color:gray" lang="EN-US"></span><pre style="white-space:pre-wrap"><span style="color:gray" lang="EN-US"></span><span style="color:gray"><a href="http://vcard.esaturnus.com/" style="color:rgb(0,0,204)" target="_blank"><span lang="EN-US"><br>
</span></a></span></pre></div></span><br>