netdev->connected = false;
- netdev->sockfd = inet_open_passive(SOCK_DGRAM, "", 0, &netdev->local_addr, 0);
+ netdev->sockfd = inet_open_passive(SOCK_DGRAM, "", 0,
+ (struct sockaddr_storage *)&netdev->local_addr, 0);
if (netdev->sockfd < 0) {
return netdev->sockfd;
}
struct netdev_tunnel *netdev =
netdev_tunnel_cast(rx_->netdev);
if (!netdev->connected)
- return -EAGAIN;
+ return EAGAIN;
for (;;) {
ssize_t retval;
retval = recv(rx->fd, buffer->data, size, MSG_TRUNC);
netdev->stats.rx_packets++;
netdev->stats.rx_bytes += retval;
if (retval <= size) {
- return retval;
+ buffer->size += retval;
+ return 0;
} else {
netdev->stats.rx_errors++;
netdev->stats.rx_length_errors++;
- return -EMSGSIZE;
+ return EMSGSIZE;
}
} else if (errno != EINTR) {
if (errno != EAGAIN) {
netdev_rx_get_name(rx_), ovs_strerror(errno));
netdev->stats.rx_errors++;
}
- return -errno;
+ return errno;
}
}
}
return error;
}
-static unsigned int
-netdev_tunnel_change_seq(const struct netdev *netdev_)
-{
- struct netdev_tunnel *netdev = netdev_tunnel_cast(netdev_);
- unsigned int change_seq;
-
-
- ovs_mutex_lock(&netdev->mutex);
- change_seq = netdev->change_seq;
- ovs_mutex_unlock(&netdev->mutex);
- return change_seq;
-}
\f
/* Helper functions. */