]> asedeno.scripts.mit.edu Git - linux.git/commit
tipc: guarantee that group broadcast doesn't bypass group unicast
authorJon Maloy <jon.maloy@ericsson.com>
Fri, 13 Oct 2017 09:04:31 +0000 (11:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Oct 2017 15:46:01 +0000 (08:46 -0700)
commit2f487712b89376fce267223bbb0db93d393d4b09
tree2f40d5c08f966de843218ff96d797fdc8ca77985
parentb87a5ea31c935a7f7e11ca85df2ec7917921e96d
tipc: guarantee that group broadcast doesn't bypass group unicast

We need a mechanism guaranteeing that group unicasts sent out from a
socket are not bypassed by later sent broadcasts from the same socket.
We do this as follows:

- Each time a unicast is sent, we set a the broadcast method for the
  socket to "replicast" and "mandatory". This forces the first
  subsequent broadcast message to follow the same network and data path
  as the preceding unicast to a destination, hence preventing it from
  overtaking the latter.

- In order to make the 'same data path' statement above true, we let
  group unicasts pass through the multicast link input queue, instead
  of as previously through the unicast link input queue.

- In the first broadcast following a unicast, we set a new header flag,
  requiring all recipients to immediately acknowledge its reception.

- During the period before all the expected acknowledges are received,
  the socket refuses to accept any more broadcast attempts, i.e., by
  blocking or returning EAGAIN. This period should typically not be
  longer than a few microseconds.

- When all acknowledges have been received, the sending socket will
  open up for subsequent broadcasts, this time giving the link layer
  freedom to itself select the best transmission method.

- The forced and/or abrupt transmission method changes described above
  may lead to broadcasts arriving out of order to the recipients. We
  remedy this by introducing code that checks and if necessary
  re-orders such messages at the receiving end.

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/group.c
net/tipc/group.h
net/tipc/link.c
net/tipc/msg.h
net/tipc/socket.c