AF_PACKET sockets have these incredibly useful semantics in where
for both non-blocking and blocking I/O, they will tell you the
socket is rwite-able, but then still return -1 and sett errno=ENOBUFS
if the current socket buffer / transmit queue is full.
All we can do is usleep and retry. The new module parameter, if set
to non-zero, determines the number of microseconds we shall sleep before
any retry. If set to zero, the existing behavior is preserved:
TTCN_error().
Related: SYS#5343
Change-Id: I1608403d94a10ae52c7e1de0f1b02687b048c01e
An AF_PACKET socket will immediately receive packets of _all_ interfaces
until it is bound to one specific interface. This introduces a race
condition between the socket() and the bind() syscall.
Let's use the ifindex passed for each packet in recvmsg() to drop
any packets received for other interfaces.
Change-Id: Icd0b23eb1d6f75ca3a05e5dd1a569fa389903fdf