37c37
< __FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 121307 2003-10-21 18:28:36Z silby $");
---
> __FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 121628 2003-10-28 05:47:40Z sam $");
890a891,892
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
900a903,904
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
942c946
< if ((flags & MSG_PEEK) == 0)
---
> if ((flags & MSG_PEEK) == 0) {
943a948,958
> /*
> * If nextrecord == NULL (this is a single chain),
> * then sb_lastrecord may not be valid here if m
> * was changed earlier.
> */
> if (nextrecord == NULL) {
> KASSERT(so->so_rcv.sb_mb == m,
> ("receive tailq 1"));
> so->so_rcv.sb_lastrecord = m;
> }
> }
946a962,967
> } else {
> if ((flags & MSG_PEEK) == 0) {
> KASSERT(so->so_rcv.sb_mb == m,("receive tailq 2"));
> so->so_rcv.sb_mb = nextrecord;
> SB_EMPTY_FIXUP(&so->so_rcv);
> }
947a969,971
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
>
973a998,999
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
1021c1047
< if (m)
---
> if (m) {
1022a1049,1056
> if (nextrecord == NULL)
> so->so_rcv.sb_lastrecord = m;
> } else {
> so->so_rcv.sb_mb = nextrecord;
> SB_EMPTY_FIXUP(&so->so_rcv);
> }
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
1066a1101,1102
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
1085c1121,1126
< if (m == 0)
---
> if (m == 0) {
> /*
> * First part is an inline SB_EMPTY_FIXUP(). Second
> * part makes sure sb_lastrecord is up-to-date if
> * there is still data in the socket buffer.
> */
1086a1128,1135
> if (so->so_rcv.sb_mb == NULL) {
> so->so_rcv.sb_mbtail = NULL;
> so->so_rcv.sb_lastrecord = NULL;
> } else if (nextrecord->m_nextpkt == NULL)
> so->so_rcv.sb_lastrecord = nextrecord;
> }
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
< __FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 121307 2003-10-21 18:28:36Z silby $");
---
> __FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 121628 2003-10-28 05:47:40Z sam $");
890a891,892
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
900a903,904
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
942c946
< if ((flags & MSG_PEEK) == 0)
---
> if ((flags & MSG_PEEK) == 0) {
943a948,958
> /*
> * If nextrecord == NULL (this is a single chain),
> * then sb_lastrecord may not be valid here if m
> * was changed earlier.
> */
> if (nextrecord == NULL) {
> KASSERT(so->so_rcv.sb_mb == m,
> ("receive tailq 1"));
> so->so_rcv.sb_lastrecord = m;
> }
> }
946a962,967
> } else {
> if ((flags & MSG_PEEK) == 0) {
> KASSERT(so->so_rcv.sb_mb == m,("receive tailq 2"));
> so->so_rcv.sb_mb = nextrecord;
> SB_EMPTY_FIXUP(&so->so_rcv);
> }
947a969,971
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
>
973a998,999
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
1021c1047
< if (m)
---
> if (m) {
1022a1049,1056
> if (nextrecord == NULL)
> so->so_rcv.sb_lastrecord = m;
> } else {
> so->so_rcv.sb_mb = nextrecord;
> SB_EMPTY_FIXUP(&so->so_rcv);
> }
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
1066a1101,1102
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);
1085c1121,1126
< if (m == 0)
---
> if (m == 0) {
> /*
> * First part is an inline SB_EMPTY_FIXUP(). Second
> * part makes sure sb_lastrecord is up-to-date if
> * there is still data in the socket buffer.
> */
1086a1128,1135
> if (so->so_rcv.sb_mb == NULL) {
> so->so_rcv.sb_mbtail = NULL;
> so->so_rcv.sb_lastrecord = NULL;
> } else if (nextrecord->m_nextpkt == NULL)
> so->so_rcv.sb_lastrecord = nextrecord;
> }
> SBLASTRECORDCHK(&so->so_rcv);
> SBLASTMBUFCHK(&so->so_rcv);