Source-Changes-HG archive

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

[src/trunk]: src/sys/kern don't print diagnostic for AF_LINK



details:   https://anonhg.NetBSD.org/src/rev/f5d4fc7f6ef3
branches:  trunk
changeset: 354941:f5d4fc7f6ef3
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 05 17:54:46 2017 +0000

description:
don't print diagnostic for AF_LINK

diffstat:

 sys/kern/uipc_domain.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r a1e858919ee2 -r f5d4fc7f6ef3 sys/kern/uipc_domain.c
--- a/sys/kern/uipc_domain.c    Wed Jul 05 17:19:52 2017 +0000
+++ b/sys/kern/uipc_domain.c    Wed Jul 05 17:54:46 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_domain.c,v 1.98 2017/07/02 02:39:18 christos Exp $        */
+/*     $NetBSD: uipc_domain.c,v 1.99 2017/07/05 17:54:46 christos Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.98 2017/07/02 02:39:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.99 2017/07/05 17:54:46 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -281,11 +281,13 @@
 static void
 sockaddr_checklen(const struct sockaddr *sa)
 {
+       // Can't tell how much was allocated, if it was allocated.
+       if (sa->sa_family == AF_LINK)
+               return;
+
        socklen_t len = sockaddr_getsize_by_family(sa->sa_family);
        if (len == 0 || len == sa->sa_len)
                return;
-       if (sa->sa_family == AF_LINK && sa->sa_len <= len)
-               return;
 
        char buf[512];
        sockaddr_format(sa, buf, sizeof(buf));



Home | Main Index | Thread Index | Old Index