Idan Yadgar has uploaded this change for review.

View Change

Bugfix: Allow listening on TCP only without IPv6 configured

In src/MainNFSD/nfs_rpc_dispatcher_thread.c we handled the case
of not having IPv6 configured when trying to create a UDPv6 socket.
If we get `errno == EAFNOSUPPORT` (Address family not supported by protocol),
we assume IPv6 is not configured, and we know not to try to create a TCPv6 socket.
We know that if we try to create a TCPv6 socket, it cannot fail, because IPv6
must be configured (if it wasn't, we would fail with UDPv6 and would not try TCPv6).
The bug is that if `Enable_UDP = false` was specified in the config, we will not
try to create UDP sockets, and we will get `errno == EAFNOSUPPORT` for the first time
when creating the TCP sockets, and then we will exit.
The fix is to check if `Enable_UDP = false` was set when we fail to create a TCPv6 socket.
If it was, we know that this is the first IPv6 socket we try to create, and we
understand that IPv6 is not configured, so we move on to use IPv4 only.

Change-Id: I4687bfb325e7c134369d6438d9f77f0b11ba664f
Signed-off-by: Idan Yadgar <idanyadgar@gmail.com>
---
M src/MainNFSD/nfs_rpc_dispatcher_thread.c
1 file changed, 45 insertions(+), 12 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/06/530706/1

To view, visit change 530706. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I4687bfb325e7c134369d6438d9f77f0b11ba664f
Gerrit-Change-Number: 530706
Gerrit-PatchSet: 1
Gerrit-Owner: Idan Yadgar <idanyadgar@gmail.com>
Gerrit-MessageType: newchange