}
/* kick-off transmits */
- if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1) {
- /* error sending -- no packets transmitted */
+ if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1 &&
+ errno != ENOBUFS && errno != EAGAIN) {
+ /*
+ * In case of a ENOBUFS/EAGAIN error all of the enqueued
+ * packets will be considered successful even though only some
+ * are sent.
+ */
+
num_tx = 0;
num_tx_bytes = 0;
}