here are my comments for libdlpi.c:

would it be better to just return one type of error code (DLPI_*)?
the other type (DL_*) can be retrieved via an interface such as
dlpi_dlerr(). the dlerr itself can be stored within the dlpi_impl_t.
this scheme will let you separate the two error spaces and callers
will not have to distinguish two types of errors by comparing
DLPI_ERRBASE.
I know it's a bit late to suggest this. I am ok if you leave the
code as is.


delete 257-259 and add:
        if (msec <= 0)
                return (DLPI_ETIMEDOUT);
to 254.

225-226:
delete the '? B_TRUE : B_FALSE'.

236:
this is equivalent to:
while (msec < 0 || msec >= 0)
so you should just change it to:
for (;;)

317-323:
this can be combined into
if ((no_ctl && databuf != NULL) || expecting(...))
        break;

552:
just do
if (... || !ifparse_ifpsec())

640:
should return the return value of dlpi_unbind() instead.

592-593,653,680,722,758-759,802,835:
should tab-align with other local variables:

827:
I don't understand the comment here.
what if someone only wants to open the device in passive mode?
he should get an error if this is not possible.

1097:
dip would get freed again by dlpi_open().
you should just close the fd here.

1009,1120:
no braces needed.

1119:
change to !ifparse_ifspec(...)

1258:
should initialize retval to DLPI_EINVAL
 
 
This message posted from opensolaris.org
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to