summaryrefslogtreecommitdiff
path: root/pfinet
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2010-10-30 00:24:32 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-10-30 00:26:10 +0000
commit871d7b945a5d0c788b68e586bd03afeb3812a834 (patch)
tree788ca1bf447813dd574cab1782d949593f188af7 /pfinet
parent0da1805bdd58125b01c3b1a9d95c3d6f495d2159 (diff)
Fix connect(AF_UNSPEC)
Fixes sshd startup on inet6-enabled systems. * pfinet/socket-ops.c (S_socket_create_address): Accept creating AF_UNSPEC addresses too. * pfinet/linux-src/net/ipv6/udp_ipv6.c (udpv6_connect): When address family is AF_UNSPEC, call udp_connect() and clear daddr, saddr, and rcv_saddr.
Diffstat (limited to 'pfinet')
-rw-r--r--pfinet/linux-src/net/ipv6/udp_ipv6.c8
-rw-r--r--pfinet/socket-ops.c3
2 files changed, 10 insertions, 1 deletions
diff --git a/pfinet/linux-src/net/ipv6/udp_ipv6.c b/pfinet/linux-src/net/ipv6/udp_ipv6.c
index 4511c024..1886e8ac 100644
--- a/pfinet/linux-src/net/ipv6/udp_ipv6.c
+++ b/pfinet/linux-src/net/ipv6/udp_ipv6.c
@@ -212,6 +212,14 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
goto ipv4_connected;
}
+ if (usin->sin6_family == AF_UNSPEC) {
+ udp_connect(sk, uaddr, addr_len);
+ ipv6_addr_set(&np->daddr, 0, 0, 0, 0);
+ ipv6_addr_set(&np->saddr, 0, 0, 0, 0);
+ ipv6_addr_set(&np->rcv_saddr, 0, 0, 0, 0);
+ return 0;
+ }
+
if (addr_len < sizeof(*usin))
return(-EINVAL);
diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c
index b9ce6c72..02675425 100644
--- a/pfinet/socket-ops.c
+++ b/pfinet/socket-ops.c
@@ -299,7 +299,8 @@ S_socket_create_address (mach_port_t server,
struct sock_addr *addrstruct;
const struct sockaddr *const sa = (void *) data;
- if (sockaddr_type != AF_INET && sockaddr_type != AF_INET6)
+ if (sockaddr_type != AF_INET && sockaddr_type != AF_INET6
+ && sockaddr_type != AF_UNSPEC)
return EAFNOSUPPORT;
if (sa->sa_family != sockaddr_type
|| data_len < offsetof (struct sockaddr, sa_data))