James Carlson writes:
> General comment: is it just me or is all this converting between
> strings and integers and back again (which exists in the underlying
> code) at least a little weird?  It seems like portlist should be
> converted to be just an int array rather than an array of strings, and
> then get rid of the subsequent parsers for portlist.

I think I'll strengthen that comment a little.  If you give it
"1-65535" as a range, the code actually makes 65535 allocations of 6
bytes each.  That's at least a half a megabyte of stuff expanded out
of a 8 byte string -- and that all needs to be parsed, one port at a
time, later.

One other thing I didn't notice the first time: calloc at line 846 is
unnecessary.  The buffer (if any is allocated) is immediately
overwritten by line 849, so the initial contents are unimportant.

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
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
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to