chiark
/
gitweb
/
~mdw
/
preload-hacks
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
noip.c: Fix some holdovers with hardcoded address families.
[preload-hacks]
/
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)
{
int socketpair(int pf, int ty, int proto, int *sk)
{
- if (
pf == PF_INET
) {
+ if (
family_known_p(pf)
) {
pf = PF_UNIX;
proto = 0;
}
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;
{
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);
});
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;
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;
PRESERVING_ERRNO({
sa = SA(msg->msg_name);
mymsg = *msg;