fs: dlm: fix build with CONFIG_IPV6 disabled
authorAlexander Aring <aahringo@redhat.com>
Wed, 17 Nov 2021 14:20:43 +0000 (09:20 -0500)
committerDavid Teigland <teigland@redhat.com>
Wed, 17 Nov 2021 14:46:23 +0000 (08:46 -0600)
commit1b9beda83e27a0c2cd75d1cb743c297c7b36c844
tree3e37e9fd669184880a1f578ba341069fbb5e7b27
parent92c44605381418b01af44c63fd27185cac368866
fs: dlm: fix build with CONFIG_IPV6 disabled

This patch will surround the AF_INET6 case in sk_error_report() of dlm
with a #if IS_ENABLED(CONFIG_IPV6). The field sk->sk_v6_daddr is not
defined when CONFIG_IPV6 is disabled. If CONFIG_IPV6 is disabled, the
socket creation with AF_INET6 should already fail because a runtime
check if AF_INET6 is registered. However if there is the possibility
that AF_INET6 is set as sk_family the sk_error_report() callback will
print then an invalid family type error.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 4c3d90570bcc ("fs: dlm: don't call kernel_getpeername() in error_report()")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c