noip.c: Fix some holdovers with hardcoded address families.
[preload-hacks] / noip.c
diff --git a/noip.c b/noip.c
index 1342a33..a1e141a 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;