Skip to content

Commit

Permalink
udp: Don't spin if a node has the wrong IP family
Browse files Browse the repository at this point in the history
If a link has nodes with a mix of IP families (eg it's set up
with IPv4 ones and an IPv6 one is added) then knet spins on sending
to an IPv6 one from a IPv4 socket with -EAFNOSUPPORT.

Yes, this is a bad config error but knet should handle it with a
little more grace.

sctp does not seem to suffer from the spinning at least

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
  • Loading branch information
chrissie-c committed Mar 26, 2019
1 parent 4818cfa commit 7c32eca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libknet/transport_udp.c
Expand Up @@ -400,7 +400,7 @@ int udp_transport_tx_sock_error(knet_handle_t knet_h, int sockfd, int recv_err,
read_errs_from_sock(knet_h, sockfd);
return 0;
}
if (recv_errno == EINVAL || recv_errno == EPERM) {
if (recv_errno == EINVAL || recv_errno == EPERM || recv_errno == EAFNOSUPPORT) {
return -1;
}
if ((recv_errno == ENOBUFS) || (recv_errno == EAGAIN)) {
Expand Down

0 comments on commit 7c32eca

Please sign in to comment.