Commit 54de8b8e authored by Max Kellermann's avatar Max Kellermann

net/*, ...: use AF_LOCAL instead of AF_UNIX

parent 79695697
...@@ -65,7 +65,7 @@ client_new(EventLoop &loop, Partition &partition, ...@@ -65,7 +65,7 @@ client_new(EventLoop &loop, Partition &partition,
assert(fd >= 0); assert(fd >= 0);
#ifdef HAVE_LIBWRAP #ifdef HAVE_LIBWRAP
if (address.GetFamily() != AF_UNIX) { if (address.GetFamily() != AF_LOCAL) {
// TODO: shall we obtain the program name from argv[0]? // TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd"; const char *progname = "mpd";
......
...@@ -82,7 +82,7 @@ AllocatedSocketAddress::SetLocal(const char *path) noexcept ...@@ -82,7 +82,7 @@ AllocatedSocketAddress::SetLocal(const char *path) noexcept
struct sockaddr_un *sun; struct sockaddr_un *sun;
SetSize(sizeof(*sun) - sizeof(sun->sun_path) + path_length); SetSize(sizeof(*sun) - sizeof(sun->sun_path) + path_length);
sun = (struct sockaddr_un *)address; sun = (struct sockaddr_un *)address;
sun->sun_family = AF_UNIX; sun->sun_family = AF_LOCAL;
memcpy(sun->sun_path, path, path_length); memcpy(sun->sun_path, path, path_length);
if (is_abstract) if (is_abstract)
......
...@@ -116,7 +116,7 @@ std::string ...@@ -116,7 +116,7 @@ std::string
ToString(SocketAddress address) noexcept ToString(SocketAddress address) noexcept
{ {
#ifdef HAVE_UN #ifdef HAVE_UN
if (address.GetFamily() == AF_UNIX) if (address.GetFamily() == AF_LOCAL)
/* return path of UNIX domain sockets */ /* return path of UNIX domain sockets */
return LocalAddressToString(*(const sockaddr_un *)address.GetAddress(), return LocalAddressToString(*(const sockaddr_un *)address.GetAddress(),
address.GetSize()); address.GetSize());
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <errno.h> #include <errno.h>
#ifdef HAVE_LIBWRAP #ifdef HAVE_LIBWRAP
#include <sys/socket.h> /* needed for AF_UNIX */ #include <sys/socket.h> /* needed for AF_LOCAL */
#include <tcpd.h> #include <tcpd.h>
#endif #endif
...@@ -157,7 +157,7 @@ HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid) ...@@ -157,7 +157,7 @@ HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid)
connected */ connected */
#ifdef HAVE_LIBWRAP #ifdef HAVE_LIBWRAP
if (address.GetFamily() != AF_UNIX) { if (address.GetFamily() != AF_LOCAL) {
const auto hostaddr = ToString(address); const auto hostaddr = ToString(address);
// TODO: shall we obtain the program name from argv[0]? // TODO: shall we obtain the program name from argv[0]?
const char *progname = "mpd"; const char *progname = "mpd";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment