From 17085e3f1ab86464e67d0d1a3c4b65b3617165a3 Mon Sep 17 00:00:00 2001 Message-Id: <17085e3f1ab86464e67d0d1a3c4b65b3617165a3.1714846501.git.mdw@distorted.org.uk> From: Mark Wooding Date: Mon, 2 May 2016 13:24:53 +0100 Subject: [PATCH] noip.c: Fix some holdovers with hardcoded address families. Organization: Straylight/Edgeware From: Mark Wooding Now all of the references to `_INET' are in the `Address-type hacking' section where they belong. This should really have been done as part of the IPv6 work, but unaccountably wasn't. --- noip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noip.c b/noip.c index 1342a33..a1e141a 100644 --- a/noip.c +++ b/noip.c @@ -1175,7 +1175,7 @@ int socket(int pf, int ty, int proto) int socketpair(int pf, int ty, int proto, int *sk) { - if (pf == PF_INET) { + if (family_known_p(pf)) { pf = PF_UNIX; proto = 0; } @@ -1227,7 +1227,7 @@ ssize_t sendto(int sk, const void *buf, size_t len, int flags, { struct sockaddr_un sun; - if (to && to->sa_family == AF_INET) { + if (to && family_known_p(to->sa_family)) { PRESERVING_ERRNO({ do_implicit_bind(sk, &to, &tolen, &sun); }); @@ -1259,7 +1259,7 @@ ssize_t sendmsg(int sk, const struct msghdr *msg, int flags) const struct sockaddr *sa; struct msghdr mymsg; - if (msg->msg_name && SA(msg->msg_name)->sa_family == AF_INET) { + if (msg->msg_name && family_known_p(SA(msg->msg_name)->sa_family)) { PRESERVING_ERRNO({ sa = SA(msg->msg_name); mymsg = *msg; -- [mdw]