- gbuf_wset(m1,len); /* *** m1 is first len bytes of m0? *** */
- gbuf_rinc(m0,len);
- if ((len = gbuf_len(m0)) < 0) {
- gbuf_rdec(m0,len);
- gbuf_wdec(m1,len);
- if (!append_copy((struct mbuf *)m1,
- (struct mbuf *)gbuf_cont(m0), wait)) {
- for (i = 0; i < cnt; i++)
- if (rc_xmt[i])
- gbuf_freem(rc_xmt[i]);
- gbuf_rptr(m0) = m0_rptr;
- gbuf_wset(m0,(m0_wptr-m0_rptr));
- return 0;
- }
- } else
- gbuf_cont(m1) = 0;
- gbuf_cont(m2) = m1;
-
- /* temp fix for page boundary problem - bug# 2703163 */
- lastPage = (caddr_t)((int)(gbuf_wptr(m1) - 1) & ~PAGE_MASK); /* 4k page of last byte */
- if (lastPage != (caddr_t)((int)(gbuf_rptr(m1)) & ~PAGE_MASK)) { /* 1st byte and last on same page ? */
- if ((m3 = gbuf_dupb_wait(m1, wait)) == NULL) {
- for (i = 0; i < cnt; i++)
- if (rc_xmt[i])
- gbuf_freem(rc_xmt[i]);
- (gbuf_rptr(m0)) = m0_rptr;
- gbuf_wset(m0, (m0_wptr - m0_rptr));
- return 0;
- }
- (gbuf_rptr(m3)) = lastPage; /* new mbuf starts at beginning of page */
- gbuf_wset(m3, (gbuf_wptr(m1) - lastPage)); /* len = remaining data crossing over page boundary */
- gbuf_wset(m1, (lastPage - (gbuf_rptr(m1)))); /* adjust len of m1 */
- (gbuf_cont(m1)) = m3;
- (gbuf_cont(m3)) = 0;
- }
- }