Great, that definitely makes more sense then :)<div><br></div><div>I'm still wondering, shouldn't this block:</div><div>if (ip->instance_id == 0)</div><div>                done0++;<br>              iid = ip->instance_id + 1;
</div><div><br></div><div>instead read:</div><div>if (iid == 0)</div><div>                done0++;<br>              iid = ip->instance_id + 1;
</div><div><br></div><div>Otherwise the condition done0>1 will only be triggered if the same interface is in multiple areas with instance ID 0. I think we want the condition to be triggered if the same interface is in multiple areas, whatever the instance ID?<br>

<br><div class="gmail_quote">On 10 May 2012 02:28, Ondrej Zajicek <span dir="ltr"><<a href="mailto:santiago@crfreenet.org" target="_blank">santiago@crfreenet.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Wed, May 09, 2012 at 06:18:19PM +0200, Benjamin Paterson wrote:<br>
>    I am intrigued by the following bit of code in BIRD 1.3.7<br>
>    proto/ospf/iface.c<br>
>    void<br>
>    ospf_ifa_notify(struct proto *p, unsigned flags, struct ifa *a)<br>
>    {<br>
>    [...]<br>
>    if (flags & IF_CHANGE_UP)<br>
>        {<br>
>          int done0 = 0;<br>
>          struct ospf_area *oa;<br>
>          WALK_LIST(oa, po->area_list)<br>
>          {<br>
>            int iid = 0;<br>
>            struct ospf_iface_patt *ip;<br>
>            while (ip = ospf_iface_patt_find(oa->ac, a->iface, iid))<br>
>            {<br>
>              ospf_iface_new(oa, a, ip);<br>
>              if (ip->instance_id == 0)<br>
>                done0++;<br>
>              iid = ip->instance_id + 1;<br>
>            }<br>
>          }<br>
>    I might be wrong here, but if I understand correctly, the code expects the<br>
>    set of instance IDs configured on each interface to be of the form [| 0, n<br>
>    |].<br>
<br>
</div>No, ospf_iface_patt_find() returns the first configured iface pattern<br>
with lowest instance id which is greater or equal to iid argument, so<br>
it would iterate through all relevant iface patterns and initialize<br>
them. If you have just one relevant pattern with iid 5, the first call<br>
would return that and second one (called with iid 6) would return NULL.<br>
<div class="im"><br>
>    In addition, I haven't seen any option to manually set Instance IDs.<br>
<br>
</div>Oops, it seems that i forgot to add this option, probably in dilemma<br>
whether it should be syntactically a regular option or some part of an<br>
iface pattern key (as it is semantically a part of the key). I will fix<br>
that.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Elen sila lumenn' omentielvo<br>
<br>
Ondrej 'SanTiago' Zajicek (email: <a href="mailto:santiago@crfreenet.org">santiago@crfreenet.org</a>)<br>
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, <a href="http://wwwkeys.pgp.net" target="_blank">wwwkeys.pgp.net</a>)<br>
"To err is human -- to blame it on a computer is even more so."<br>
</font></span><br>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.9 (GNU/Linux)<br>
<br>
iEUEARECAAYFAk+rC8QACgkQw1GB2RHercN5KQCdHpTRh8bdgUHhQ2k30GpJn4li<br>
4BQAmILLroqL6+qUsIVf2hXxMqzodRQ=<br>
=zSdI<br>
-----END PGP SIGNATURE-----<br>
<br></blockquote></div><br></div>