[quagga-dev 5270] Re: mes_lookup / LOOKUP robustness

James Carlson james.d.carlson at Sun.COM
Tue Feb 26 22:31:05 GMT 2008


Paul Jakma writes:
> > Other implementations may tolerate NULL args differently though.
> 
> Yep. See also:
> 
>   http://www.opensolaris.org/jive/thread.jspa;?messageID=46911

Indeed.

I'm somewhat unconvinced, though, that mes_lookup ought to return
anything as grotty as "(nil)".  Either the set of messages is large
and dependent on something not in the design of the code itself (e.g.,
LOOKUP(attr_str, type) in bgp_attr.c), so some sort of
legible-to-humans "not found in list" entry needs to be possible, or
the set is constrained by the design (most of the ospfd usages) and
anything outside the range should intentionally drop core, because
it's a bug.

I don't think "(nil)" really satisfies either situation, and it looks
at least a bit ugly to me to use the same common function for two very
different cases.

-- 
James Carlson, Solaris Networking              <james.d.carlson at sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677



More information about the Quagga-dev mailing list