omshell lease ends field invalid characters

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

omshell lease ends field invalid characters

Rick Dicaire
Hi folks, I wrote a script that invokes omshell and noticed a couple leases having non hex values in the 'ends' field. Checking those leases in /var/state/dhcp/dhcpd.leases shows valid dates.

Running dhcpd 4.4.2 with a customized ddns configuration. 

From dhcpd.leases:

lease 192.168.17.158 {
  starts 2 2020/09/29 06:17:17;
  ends 2 2020/09/29 18:17:17;
  cltt 2 2020/09/29 06:43:07;
  binding state active;
  next binding state free;
  rewind binding state free;
  hardware ethernet f4:f5:d8:42:52:10;
  set ddns-rev-name = "158.17.168.192.in-addr.arpa.";
  set ddns-txt = "004a9b9d459dc48a4aae47026174068ad9";
  set ddns-fwd-name = "Chromecast.dhcp.labdev.";
  set clientddns = "Chromecast";
  set clienthost = "Chromecast";
  set clientmac = "f4:f5:d8:42:52:10";
  set clientip = "192.168.17.158";
  set clientdomain = "dhcp.labdev.";
  set vendor-class-identifier = "dhcpcd-6.8.2:Linux-3.8.13+:armv7l:Marvell";
  client-hostname "Chromecast";
  on expiry {
    execute ("/usr/local/sbin/hook_dhcpd.sh", "expiry", clientip,
        concat (concat (clientddns, "."), clientdomain), clienthost, clientmac);
  }
  on release {
    execute ("/usr/local/sbin/hook_dhcpd.sh", "release", clientip,
        concat (concat (clientddns, "."), clientdomain), clienthost, clientmac);
  }
}


From omshell output:

echo "server dns1
key daw3-ddns keyval
connect
new lease
set ip-address = 192.168.17.158
open"|omshell
> > > obj: <null>
> obj: lease
> obj: lease
ip-address = c0:a8:11:9e
> obj: lease
ip-address = c0:a8:11:9e
state = 00:00:00:02
client-hostname = "Chromecast"
subnet = 00:00:00:03
pool = 00:00:00:04
hardware-address = f4:f5:d8:42:52:10
hardware-type = 00:00:00:01
ends = "_sz-"
starts = 5f:72:d1:6d
tstp = 00:00:00:00
tsfp = 00:00:00:00
atsfp = 00:00:00:00
cltt = 5f:72:d7:7b
flags = 00
ddns-rev-name = "158.17.168.192.in-addr.arpa."
ddns-txt = "004a9b9d459dc48a4aae47026174068ad9"
ddns-fwd-name = "Chromecast.dhcp.labdev."
clientddns = "Chromecast"
clienthost = "Chromecast"
clientmac = "f4:f5:d8:42:52:10"
clientip = "192.168.17.158"
clientdomain = "dhcp.labdev."
vendor-class-identifier = "dhcpcd-6.8.2:Linux-3.8.13+:armv7l:Marvell"


As shown above, 'ends' field does not have a hex value.
Any thoughts as to what's causing this?

Thanks



_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: omshell lease ends field invalid characters

Rick Dicaire
Wow great catch...the date value of your hex conversion corresponds with what I see in dhcpd.leases.
I can try and script for this, but should a bug be filed, or could this be a terminal issue (I get same result from console terminal and xterm/ssh session)?

On Tue, Sep 29, 2020 at 12:09 PM Rick Dicaire <[hidden email]> wrote:
Wow great catch...the date value of your hex conversion corresponds with what I see in dhcpd.leases.
I can try and script for this, but should a bug be filed, or could this be a terminal issue (I get same result from console terminal and xterm/ssh session)?

On Tue, Sep 29, 2020 at 8:32 AM Bruce Hudson <[hidden email]> wrote:
> ends = "_sz-"
> starts = 5f:72:d1:6d

> As shown above, 'ends' field does not have a hex value.
> Any thoughts as to what's causing this?

    I suspect this is just an anomaly cause by omshell's more
generic output algorithm. Because all four bytes of the ends
value correspond to printable characters, it displays it as
a string instead of the raw octects. A (failed in this case)
effort to be more user friendly.

    Looking at the ord's of the four characters in hex:

        "_sz-" ==> 5f:73:7a:2d
--
Bruce A. Hudson                         | [hidden email]
ITS, Networks and Systems               |
Dalhousie University                    |
Halifax, Nova Scotia, Canada            | (902) 494-3405

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users