From d8f9ddbf411b05a1fa7cdd637b83822ebce59fea Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 15 Jul 1995 22:33:26 +0000 Subject: Formerly socket.c.~9~ --- pflocal/socket.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pflocal') diff --git a/pflocal/socket.c b/pflocal/socket.c index 2e694815..492f149f 100644 --- a/pflocal/socket.c +++ b/pflocal/socket.c @@ -195,11 +195,18 @@ S_socket_send (struct sock_user *user, struct addr *dest_addr, unsigned flags, if (err) return err; + if (user->sock->read_pipe->class != dest_sock->read_pipe->class) + /* Sending to a different type of socket! */ + return EINVAL; /* ? XXX */ + err = sock_get_addr (user->sock, &source_addr); if (!err) { /* Grab the destination socket's read pipe directly, and stuff data - into it. */ + into it. This is not quite the usage sock_aquire_read_pipe was + intended for, but it will work, as the only inappropiate errors + occur on a broken pipe, which shouldn't be possible with the sort of + sockets with which we can use socket_send... XXXX */ err = sock_aquire_read_pipe (dest, &pipe); if (!err) { -- cgit v1.2.3