Hello Dave,
I'am currently porting my STREAMS based rdm protocol from Solaris 2.5
to linux with the help of your LiS-2.6 STREAMS environment.
While searching for a bug, which locks the system I found out that your dupb()
function
behaves in a different way to the Solaris implementation.
dupb shouldn't copy the contents of the b_cont pointer of the block.
According to Stephen Rago's "UNIX System V Network Programming" pp. 450 only
the b_wptr, b_rptr and b_datap are copied.
Problems will arise if you are going the linkb the new block to a message.
I don't know if it is possible to change the behaviour, because other people's
implementation
are may already base on this behaviour.
Best regards,
Oliver
/*
* lis_dupb - duplicate a message block, updating the reference count.
* The data block and data buffer are reused.
*/
mblk_t *
lis_dupb(mblk_t *mp)
{
if (mp)
{
mblk_t *bp = allocb(0, BPRI_MED);
if (bp)
{
*bp = *mp;
mp->b_datap->db_ref++;
return bp;
}
}
return NULL;
} /*lis_dupb*/
Web archives for lists can be found at http://gsyc.escet.urjc.es/lists