RestrictAddressFamilies prevent app from functionning

as per the package_linter recommandation, I added in the service for my app (calibreweb) a bunch of lines for security hardenning.

However, the line RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 prevents some functions to work.
We got following error message : Connection aborted.', OSError(97, 'Address family not supported by protocol')

I don’t have the faintest idea of what these lines do, I just copy/paste them. So as a work around, I could just comment that line, but what would be the correct way to do it to keep the app secure?

They limit on which types of interfaces the app can communicate. For apps deploying their own internal servers, try adding AF_NETLINK.

Example :

Source: I have no f’ idea either, it’s so convoluted.