DHCPv6 and 'on commit'

Bill Shirley Bill at Henagar.PolymerIndustries.biz
Mon Sep 29 12:49:58 UTC 2014


On 9/26/2014 7:50 AM, Espen Tallaksen wrote:
> Hi
> Regarding DHCPv6 i would like to do different things inside 'on commit' event braces based on what the server actually 
> is commiting (Non-temporary Address or Prefix-delegation).
> Does anybody know if there's a way to know if an 'on commit' event happened because of committing an IA-NA or IA-PD?
>
>
> This is what i try:
>
> on commit {
>         if option dhcp6.ia-na = option dhcp6.ia-na{
> set iana = binary-to-ascii(16,16,":",substring(suffix(option dhcp6.ia-na,24),0,16));
> }
> if option dhcp6.ia-pd = option dhcp6.ia-pd{
>  set iapd = binary-to-ascii(16,16,":", suffix(option dhcp6.ia-pd,16));
> set pdsize = binary-to-ascii(10,8,":",substring(suffix(option dhcp6.ia-pd,17),0,1));
> set pdnet = concat(iapd, "/", pdsize);
> }
>
> set cm = v6relay(1, (binary-to-ascii(16, 8, ":", option docsis.cm-mac-address)));
> set ifname = v6relay(1, option dhcp6.interface-id);
> set lla = (binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6)));
>
>         if option dhcp6.ia-na = option dhcp6.ia-na{
> execute("something", ARG-LIST...);
> }
> }
> if option dhcp6.ia-pd = option dhcp6.ia-pd{
> execute("something", ARG-LIST...);
> }
> }
>     }
>
>
>
> My problem is that if clients happens to request for both IA Address and IA Prefix inside the same dhcpv6 request 
> (which i find quite usual), both execute statements will be executed for both commit events (commit for IA-NA, and 
> commit for IA-PD). Result is that execute statements are blocking the daemon more than nescesary.
>
> Any thoughts?
>
>
>
> Best Regards
> Espen Tallaksen
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
Won't these always be true:
if option dhcp6.ia-na = option dhcp6.ia-na{

if option dhcp6.ia-pd = option dhcp6.ia-pd{



http://linux.die.net/man/5/dhcp-eval
Perhaps use an elsif for the 2nd test:
if option dhcp6.ia-na = option dhcp6.ia-na{
execute("something", ARG-LIST...);
}

} elsif option dhcp6.ia-pd = option dhcp6.ia-pd{

   execute("something", ARG-LIST...);
}
}

Bill


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20140929/9db0be5e/attachment.html>


More information about the dhcp-users mailing list