[EMAIL PROTECTED] wrote:
> Some background: I ran into this question when I was trying to
> coalesce the various duplicated calls of the form:
> if (IPIF_CAN_LOOKUP(..)) {
> :
> } else if IPIF_CAN_WAIT(..) {
> :
> }
> (See CR 6606222)
Once Clearview IPMP integrates I think we can actually remove all cases
of IPIF_CAN_WAIT. The only hard case of IPIF_CHANGING is when IPMP is
moving an ipif between ills, and with Clearview IPMP that will no longer
be done (the ipifs will hang of the "ipmpN" ill and not move due to
failures or repairs).
Thus I don't think it makes sense trying to improve the use of
IPIF_CAN_WAIT right now.
> I was hoping (in the case of ipif_lookup_addr* functions) to eliminate
> the 2 loops (first with ptp set to FALSE, second with ptp set to TRUE)
> into one loop that tests
> if (((ipif->ipif_flags & IPIF_POINTOPOINT) &&
> (ipif->ipif_pp_dst_addr == addr)) ||
> (!(ipif->ipif_flags & IPIF_POINTOPOINT) &&
> (ipif->ipif_lcl_addr == addr)) {
> /* return ipif if possible */
> }
> Would that break something? From cscope examination, it seemed to me
> that UNNUMBERED only gets set if POINTOPOINT is set.
The above missing the case of matching the local address on a
pointopoint which does not have unnumbered set.
It *might* be sufficient to make it be
switch (ipif->ipif_flags & (IPIF_POINTOPOINT|IPIF_UNNUMBERED)) {
case IPIF_POINTOPOINT:
/* Match both local and remote */
if (ipif->ipif_pp_dst_addr == addr)
return (ipif);
/* FALLTHRU */
case 0:
if (ipif->ipif_lcl_addr == addr)
return (ipif);
break;
case (IPIF_POINTOPOINT|IPIF_UNNUMBERED):
/* Match just the remote address */
if (ipif->ipif_pp_dst_addr == addr)
return (ipif);
break;
default:
ASSERT(0);
}
but I haven't re-read the existing code to see if the above is identical
in all cases to what the code currently does.
Erik
_______________________________________________
networking-discuss mailing list
[email protected]