[clearview-discuss] Request for codereview: CR 6761558 (libdlpi API issue)
Girish Moodalbail
Girish.Moodalbail at Sun.COM
Mon Dec 22 13:52:07 PST 2008
On 12/22/08 16:46, Peter Memishian wrote:
> > >> * Please remove all the additional ()'s you've added. It just
> > >> clutters up the code. Likewise for the needless `int' cast
> > >> on line 1486; these types are compatible without the cast.
> >
> > Meem, I think we still would need the 'int' cast because
> > DL_NOTIFY_IND_SIZE is set to 'sizeof (dl_notify_ind_t)'. So sizeof
> > returns an unsigned value and clt.len is of type 'int'. The issue is if
> > getmsg() returns with no control message then ctl.len will be -1, which
> > is represented as 0xffffffff and this is always greater than 'sizeof
> > (dl_notify_ind_t)'. So we need the 'int' cast.
>
> Surely the code can be refactored to avoid it, as in the original code.
>
Sure.
Meem, are you fine with other changes, like the LINT removals and
skipping over a malformed NOTIFICATION changes.
thanks
~Girish
More information about the clearview-discuss
mailing list