<div dir="ltr">Hi<div>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).<br><div>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?</div></div><div><br></div><div><br></div><div>This is what i try:</div><div><br></div><div><div>on commit {</div><div>        if option dhcp6.ia-na = option dhcp6.ia-na{</div><div><span class="" style="white-space:pre">          </span>set iana = binary-to-ascii(16,16,":",substring(suffix(option dhcp6.ia-na,24),0,16));</div><div><span class="" style="white-space:pre">     </span>}<br></div><div><span class="" style="white-space:pre">        </span>if option dhcp6.ia-pd = option dhcp6.ia-pd{</div><div><span class="" style="white-space:pre">        </span>        set iapd = binary-to-ascii(16,16,":", suffix(option dhcp6.ia-pd,16));</div><div><span class="" style="white-space:pre">                </span>set pdsize = binary-to-ascii(10,8,":",substring(suffix(option dhcp6.ia-pd,17),0,1));</div><div><span class="" style="white-space:pre">             </span>set pdnet = concat(iapd, "/", pdsize);</div><div><span class="" style="white-space:pre">   </span>}<br></div><div><br></div><div><span class="" style="white-space:pre">       </span>set cm = v6relay(1, (binary-to-ascii(16, 8, ":", option docsis.cm-mac-address)));<br></div><div><span class="" style="white-space:pre">      </span>set ifname = v6relay(1, option dhcp6.interface-id);</div><div><span class="" style="white-space:pre">        </span>set lla = (binary-to-ascii(16, 8, ":", suffix(option dhcp6.client-id, 6)));</div><div><br></div><div>        if option dhcp6.ia-na = option dhcp6.ia-na{</div><div><span class="" style="white-space:pre">               </span>execute("something", ARG-LIST...);<br></div><div><span class="" style="white-space:pre">             </span>}<br></div><div><span class="" style="white-space:pre">        </span>}</div><div><span class="" style="white-space:pre">  </span>if option dhcp6.ia-pd = option dhcp6.ia-pd{</div><div><span class="" style="white-space:pre">        </span>         execute("something", ARG-LIST...);<br></div><div><span class="" style="white-space:pre">                </span>}<br></div><div><span class="" style="white-space:pre">        </span>}</div><div><span class="" style="white-space:pre">  </span></div><div>    }<br></div></div><div><br></div><div><br></div><div><br></div><div>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.</div><div><br></div><div>Any thoughts?</div><div><br></div><div><br></div><div><br></div><div>Best Regards</div><div>Espen Tallaksen</div></div>