"raw packet not available" when execute() on release

Nicolas C. dhcp at nryc.fr
Tue May 1 15:52:31 UTC 2012


On 01/05/2012 02:08, Glenn Satchell wrote:
> Hi Nicolas
>
> Can you post your dhcpd.conf? It depends when you call execute, if it's
> done during, for example, DHCPDISCOVER, then the packet does not contain
> an IP address yet.
>
> You can test the value of option dhcp-message-type (man dhcp-options).
> You probably only want to do a DNS update during state DHCPACK and
> DHCPRELEASE.
>
> if option dhcp-message-type = 5 {
> execute ( ..... )
> }

Hello,

Apparently "leased-address" and "hardware" aren't available when the 
lease expires. Instead of treading both the same way :

on expiry or release {
   execute (
            "/usr/local/bin/ddns-ipv6",
            prefix,
            "-d",
            ddns-hostname,
            binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)),
            binary-to-ascii(10, 8, ".", leased-address)
   );
}

I need to tread them separately.

on release {
   execute (
            "/usr/local/bin/ddns-ipv6",
            prefix,
            "-d",
            ddns-hostname,
            binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)),
            binary-to-ascii(10, 8, ".", leased-address)
   );
}

on expiry {
   execute (
            "/usr/local/bin/ddns-ipv6",
            prefix,
            "-d",
            ddns-hostname
   );
}

The problem is that I really need the IPv4 address and the hardware 
address, I found a workaround by registering a TXT record to store them 
but it would be so much easier if I had them directly.

This is how my forward zone looks for each hostname now :

hostname TTL IN A IPv4 (added by dhcpd)
hostname TTL IN AAAA IPv6 (added by "execute")
hostname TTL IN TXT DHCPID (added by dhcpd)
cache-ddns-hostname TTL IN TXT mac-address IPv4 (added by "execute")

Nicolas


More information about the dhcp-users mailing list