- } else /* cmd == PRCO_GETOPT */ {
- register int len = tpcb->tp_Xrcv.sb_cc;
-
- /* getsockopt() allocated an mbuf but it's a whole lot easier
- * to do an m_copy than to explicitly copy from the socket buf
- * into the buffer provided by getsockopt()
- */
- IFDEBUG(D_REQUEST)
- dump_mbuf(tpcb->tp_Xrcv.sb_mb,
- "tp_ctlout: tpXrcv before sbdrop");
- ENDDEBUG
- if(len) {
- (void) m_freem(*mp);
- *mp = m_copy( tpcb->tp_Xrcv.sb_mb, 0, len);
- if( *mp != MNULL ) {
- (*mp)->m_act = 0;
- sbdrop( &tpcb->tp_Xrcv, len);
- } else {
- error = ENOBUFS;
- }
- } else {
- (*mp)->m_len = 0;
- }
- IFDEBUG(D_REQUEST)
- dump_mbuf(tpcb->tp_Xrcv.sb_mb,
- "tp_ctlout: tpXrcv after sbdrop");
- ENDDEBUG
- /* a potential problem here is that REAL expedited may have arrived
- * after the data-on-connect
- * however, this presently works because incoming XPD_TPDUs are
- * dropped if tp_Xrcv.sb_cc != 0
- */
-
- if( tpcb->tp_Xrcv.sb_cc == 0)
- tpcb->tp_flags &=
- optname == TPOPT_CONN_DATA?~TPF_CONN_DATA_IN:~TPF_DISC_DATA_IN;