diff options
-rw-r--r-- | pflocal/socket.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pflocal/socket.c b/pflocal/socket.c index 516bfbff..00907fbd 100644 --- a/pflocal/socket.c +++ b/pflocal/socket.c @@ -110,12 +110,29 @@ S_socket_listen (struct sock_user *user, int queue_limit) error_t S_socket_connect (struct sock_user *user, struct addr *addr) { + struct sock *peer; + + if (! user) + return EOPNOTSUPP; + if (!addr) + return EADDRNOTAVAIL; + + err = addr_get_sock (addr, &peer); + if (err) + return err; + + return sock_connect (user->sock, peer); +} + +error_t +S_socket_bind (struct sock_user *user, struct addr *addr) +{ if (! user) return EOPNOTSUPP; if (!addr) return EADDRNOTAVAIL; - + return sock_bind (user->sock, addr); } error_t |