From: Mark Wooding Date: Mon, 2 May 2016 12:24:53 +0000 (+0100) Subject: noip.c: Fix some holdovers with hardcoded address families. X-Git-Tag: 1.2.0~45 X-Git-Url: https://git.distorted.org.uk/~mdw/preload-hacks/commitdiff_plain/17085e3f1ab86464e67d0d1a3c4b65b3617165a3?hp=99222954396fb6ad618fea50123c5fa565b78ed6 noip.c: Fix some holdovers with hardcoded address families. 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. --- 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;