summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_usrreq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 4fe59fc..2c225fb 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -467,6 +467,9 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
cap_rights_t rights;
char *buf;
+ if (nam->sa_family != AF_UNIX)
+ return (EAFNOSUPPORT);
+
unp = sotounpcb(so);
KASSERT(unp != NULL, ("uipc_bind: unp == NULL"));
@@ -1278,6 +1281,9 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam,
cap_rights_t rights;
int error, len;
+ if (nam->sa_family != AF_UNIX)
+ return (EAFNOSUPPORT);
+
UNP_LINK_WLOCK_ASSERT();
unp = sotounpcb(so);
OpenPOWER on IntegriCloud