Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern change return from EINVAL to EAFNOSUPPORT when the ...



details:   https://anonhg.NetBSD.org/src/rev/7703b0a75756
branches:  trunk
changeset: 337186:7703b0a75756
user:      rtr <rtr%NetBSD.org@localhost>
date:      Sun Apr 05 23:19:56 2015 +0000

description:
change return from EINVAL to EAFNOSUPPORT when the domain of the socket
does not match the family of the address to be bound.

fixes atf test lib/libc/sys/t_bind bind_foreign_family

diffstat:

 sys/kern/uipc_socket.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 64cd42923273 -r 7703b0a75756 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Sun Apr 05 23:17:41 2015 +0000
+++ b/sys/kern/uipc_socket.c    Sun Apr 05 23:19:56 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.237 2015/04/05 02:26:39 rtr Exp $    */
+/*     $NetBSD: uipc_socket.c,v 1.238 2015/04/05 23:19:56 rtr Exp $    */
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.237 2015/04/05 02:26:39 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.238 2015/04/05 23:19:56 rtr Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -631,7 +631,7 @@
        solock(so);
        if (nam->sa_family != so->so_proto->pr_domain->dom_family) {
                sounlock(so);
-               return EINVAL;
+               return EAFNOSUPPORT;
        }
        error = (*so->so_proto->pr_usrreqs->pr_bind)(so, nam, l);
        sounlock(so);



Home | Main Index | Thread Index | Old Index