diff options
Diffstat (limited to 'pflocal/socket.c')
-rw-r--r-- | pflocal/socket.c | 9 |
1 files changed, 8 insertions, 1 deletions
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) { |