I'm using C Sockets to send ICMP packets with the MSG_DONTWAIT flag set. My program is single threaded but it expected to send messages at high frequency so I'm setting the message send as non blocking. Is it safe to share/modify/reuse the message buffer after each call ? (Unless EAGAIN or EWOULDBLOCK is returned).
msg_control (the ancillary data) is reused and msg_control->struct in_pktinfo->ipi_ifindex (outbound interface ifindex) is modified between calls.
The iov.iov_base buffer content (not pointer!) and iov.iov_len can also change between calls. (Less likely but still possible).
Is it OK to change ifinex and iov_base content between calsl at high frequency in non blocking mode ? (unless I get back EAGAIN or EWOULDBLOCK)
Thanks !