+ mbp = (msgbuf_t *) (scm->socket_rx_buffer);
+ data_len = ntohl (mbp->data_len);
+ current_rx_index = vec_len (scm->socket_rx_buffer);
+ vec_validate (scm->socket_rx_buffer, current_rx_index + data_len);
+ _vec_len (scm->socket_rx_buffer) = current_rx_index;
+ mbp = (msgbuf_t *) (scm->socket_rx_buffer);
+ msg_size = data_len + sizeof (*mbp);
+
+ while (vec_len (scm->socket_rx_buffer) < msg_size)
+ {
+ n = read (scm->socket_fd,
+ scm->socket_rx_buffer + vec_len (scm->socket_rx_buffer),
+ msg_size - vec_len (scm->socket_rx_buffer));
+ if (n < 0 && errno != EAGAIN)
+ {
+ clib_unix_warning ("socket_read");
+ return -1;
+ }
+ _vec_len (scm->socket_rx_buffer) += n;
+ }