OMAPI lookup by IP fails for static host entries

Matt Brown matt at mattb.net.nz
Tue Oct 31 00:50:28 UTC 2006


Hi There,
I have an application where I want to lookup the mac address associated
with a particular IP address via OMAPI.

This is working fine for dynamically allocated leases, but for hosts
where I have specified a static address in the dhcp configuration there
is no lease found. I understand this is by design...

So my fallback plan was to query the server for a static host entry in
the case where a lease isn't found. Unfortunately this doesn't seem to
work, despite my quick skim of dhcp_host_lookup in omapi.c suggesting
that there is support for looking up hosts via IP. Looking up the host
entry by the hardware address succeeds with no problems.

The only complicating factor that I can think of is that the host entry
is not present in the configuration file, it too is added via OMAPI, I
wouldn't have expected this to cause problems though...

Is this a bug or am I missing something? Example omshell session below:

> new host
obj: host
> set ip-address = 10.1.50.10
obj: host
ip-address = 0a:01:32:0a
> open
can't open object: not found
obj: host
ip-address = 0a:01:32:0a

> new host
obj: host
> set hardware-addressobj: host
hardware-address = 00:16:6f:49:b6:b4
> open
obj: host
hardware-address = 00:16:6f:49:b6:b4
ip-address = 0a:01:32:0a:b6:b4
name = "nh4546a1c60816f040"
hardware-type = 00:00:00:01

I'm using 3.0.3, but didn't notice any relevant changes in the 3.0.4
changelog.

Thanks in advance for your help.

-- 
Matt Brown
matt at mattb.net.nz
Mob +64 21 611 544 www.mattb.net.nz




More information about the dhcp-users mailing list