HomeClusterLabs Projects

[udp] fix incorrect return code

Description

[udp] fix incorrect return code

UDP TX is tricky and racy and in theory TX never fails, as UDP is allowed
to drop packets internally anyway.

In some race condition situations, we can endup in a situation where:

  • thread X attempts to send a packet
  • socket receives an ICMP back (for whatever reasons) generated by some other random thread/packet combo
  • thread X detects an error in TX and decode the error (correct)

pre patch:

  • thread X would treat that as error and drop the packet

post patch:

  • thread X should simply resend the packet

simply also the ordering of parsing socket error code to make it easier to read

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

Details

Provenance
fabbioneAuthored on Oct 17 2017, 10:36 AM
Parents
rK702d8f5ada83: Merge pull request #53 from digimer/master
Branches
Unknown
Tags
Unknown

Event Timeline