net/*, ...: use AF_LOCAL instead of AF_UNIX
This commit is contained in:
parent
796956970e
commit
54de8b8e77
|
@ -65,7 +65,7 @@ client_new(EventLoop &loop, Partition &partition,
|
|||
assert(fd >= 0);
|
||||
|
||||
#ifdef HAVE_LIBWRAP
|
||||
if (address.GetFamily() != AF_UNIX) {
|
||||
if (address.GetFamily() != AF_LOCAL) {
|
||||
// TODO: shall we obtain the program name from argv[0]?
|
||||
const char *progname = "mpd";
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ AllocatedSocketAddress::SetLocal(const char *path) noexcept
|
|||
struct sockaddr_un *sun;
|
||||
SetSize(sizeof(*sun) - sizeof(sun->sun_path) + path_length);
|
||||
sun = (struct sockaddr_un *)address;
|
||||
sun->sun_family = AF_UNIX;
|
||||
sun->sun_family = AF_LOCAL;
|
||||
memcpy(sun->sun_path, path, path_length);
|
||||
|
||||
if (is_abstract)
|
||||
|
|
|
@ -116,7 +116,7 @@ std::string
|
|||
ToString(SocketAddress address) noexcept
|
||||
{
|
||||
#ifdef HAVE_UN
|
||||
if (address.GetFamily() == AF_UNIX)
|
||||
if (address.GetFamily() == AF_LOCAL)
|
||||
/* return path of UNIX domain sockets */
|
||||
return LocalAddressToString(*(const sockaddr_un *)address.GetAddress(),
|
||||
address.GetSize());
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_LIBWRAP
|
||||
#include <sys/socket.h> /* needed for AF_UNIX */
|
||||
#include <sys/socket.h> /* needed for AF_LOCAL */
|
||||
#include <tcpd.h>
|
||||
#endif
|
||||
|
||||
|
@ -157,7 +157,7 @@ HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid)
|
|||
connected */
|
||||
|
||||
#ifdef HAVE_LIBWRAP
|
||||
if (address.GetFamily() != AF_UNIX) {
|
||||
if (address.GetFamily() != AF_LOCAL) {
|
||||
const auto hostaddr = ToString(address);
|
||||
// TODO: shall we obtain the program name from argv[0]?
|
||||
const char *progname = "mpd";
|
||||
|
|
Loading…
Reference in New Issue