Fix CID 168583
@@ -4675,17 +4675,18 @@ sctp_pull_off_control_to_new_inp(struct sctp_inpcb *old_inp,
struct sctp_queued_to_read *control, *nctl;
struct sctp_readhead tmp_queue;
struct mbuf *m;
+#if defined(__FreeBSD__) || defined(__APPLE__)
int error = 0;
+#endif
old_so = old_inp->sctp_socket;
new_so = new_inp->sctp_socket;
TAILQ_INIT(&tmp_queue);
+#if defined(__FreeBSD__) || defined(__APPLE__)
#if defined(__FreeBSD__) && __FreeBSD_version < 700000
SOCKBUF_LOCK(&(old_so->so_rcv));
#endif
-#if defined(__FreeBSD__) || defined(__APPLE__)
error = sblock(&old_so->so_rcv, waitflags);
-#endif
#if defined(__FreeBSD__) && __FreeBSD_version < 700000
SOCKBUF_UNLOCK(&(old_so->so_rcv));
#endif
@@ -4702,6 +4703,7 @@ sctp_pull_off_control_to_new_inp(struct sctp_inpcb *old_inp,
*/
return;
}
+#endif
/* lock the socket buffers */
SCTP_INP_READ_LOCK(old_inp);
TAILQ_FOREACH_SAFE(control, &old_inp->read_queue, next, nctl) {
