DHCPv6 and 'on commit'
Espen Tallaksen
espen.tallaksen at gmail.com
Mon Sep 29 13:56:50 UTC 2014
Hi
Thanks for reply.
>From my understanding, "if option dhcp6.ia-na = option dhcp6.ia-na" will
return false if the option does not exist. However, it might be more
convenient to use "if exist option dhcp6.ia-na".
Regarding suggestion for 2nd test by using elsif, in my theory i think i'll
never hit that test if both IA-NA and IA-PD are inside the same
dhcpv6-request. But i will give it a try, i'll let you know if it works.
Thanks again.
BR
Espen
2014-09-29 14:49 GMT+02:00 Bill Shirley <Bill at henagar.polymerindustries.biz>
:
> 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 listdhcp-users at lists.isc.orghttps://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
>
>
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20140929/0c71241e/attachment-0001.html>
More information about the dhcp-users
mailing list