* (fhandler_socket::getsockname): Fix length returned for unbound

AF_LOCAL sockets.
	(fhandler_socket::getpeername): Ditto.
	* net.cc (socketpair): Don't set sun_path and peer_sun_path to
	make sure getsockname and getpeername return the correct values
	for AF_LOCAL sockets.
This commit is contained in:
Corinna Vinschen
2009-08-14 06:58:44 +00:00
parent 95a1cc7024
commit c1999c4b0c
3 changed files with 11 additions and 6 deletions

View File

@@ -2866,8 +2866,6 @@ socketpair (int family, int type, int protocol, int *sb)
if (sb0 >= 0 && fdsock (sb0, dev, insock))
{
((fhandler_socket *) sb0)->set_sun_path ("");
((fhandler_socket *) sb0)->set_peer_sun_path ("");
((fhandler_socket *) sb0)->set_addr_family (family);
((fhandler_socket *) sb0)->set_socket_type (type);
((fhandler_socket *) sb0)->connect_state (connected);
@@ -2878,8 +2876,6 @@ socketpair (int family, int type, int protocol, int *sb)
if (sb1 >= 0 && fdsock (sb1, dev, outsock))
{
((fhandler_socket *) sb1)->set_sun_path ("");
((fhandler_socket *) sb1)->set_peer_sun_path ("");
((fhandler_socket *) sb1)->set_addr_family (family);
((fhandler_socket *) sb1)->set_socket_type (type);
((fhandler_socket *) sb1)->connect_state (connected);