chiark / gitweb /
noip.c: Fix some holdovers with hardcoded address families.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 2 May 2016 12:24:53 +0000 (13:24 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 2 May 2016 23:11:50 +0000 (00:11 +0100)
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

diff --git a/noip.c b/noip.c
index 1342a338634ff51a3b55f43c648fb10986e421c1..a1e141aca122b92d643674c9179b0f2ed666c9d7 100644 (file)
--- 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;