<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFCC">
For the third substring, I see you get an "e", but if the original
string is 6 letters, that would be the result as well, substring
should return the next length characters or until the end of the
string counting from the offset point.<br>
<br>
The other possible difference might be the binary-to-ascii
conversion, if that is not in the log section.<br>
<br>
<div class="moz-cite-prefix">On 16/12/12 21:02, Nico De Ranter
wrote:<br>
</div>
<blockquote
cite="mid:CALVv0fbqVS-HkwwbF743GNBBY1Za7qxSFE8d1PhZqTaB_h5qjg@mail.gmail.com"
type="cite"><br>
<br>
<div class="gmail_quote">On Sun, Dec 16, 2012 at 6:04 PM, Peter
Rathlev <span dir="ltr"><<a moz-do-not-send="true"
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
moz-do-not-send="true" 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
moz-do-not-send="true" 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 moz-do-not-send="true"
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
moz-do-not-send="true"
src="https://www.google.com/a/esaturnus.com/images/logo.gif?alpha=1"><br>
<span style="color:gray" lang="EN-US"></span></p>
<span style="color:gray"><a moz-do-not-send="true"
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 moz-do-not-send="true" href="http://vcard.esaturnus.com/" style="color:rgb(0,0,204)" target="_blank"><span lang="EN-US">
</span></a></span></pre>
</div>
</span><br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
dhcp-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Best regards
Sten Carlsen
No improvements come from shouting:
"MALE BOVINE MANURE!!!"
</pre>
</body>
</html>