Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Don't output debugging logs just if DIAGNOSTIC
details: https://anonhg.NetBSD.org/src/rev/c59ad2b94097
branches: trunk
changeset: 353301:c59ad2b94097
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Fri Apr 28 05:56:33 2017 +0000
description:
Don't output debugging logs just if DIAGNOSTIC
Also make log messages informative.
diffstat:
sys/netinet/in.c | 20 ++++++++++++++------
sys/netinet6/in6.c | 22 +++++++++++++++++-----
2 files changed, 31 insertions(+), 11 deletions(-)
diffs (94 lines):
diff -r f8ef1f112273 -r c59ad2b94097 sys/netinet/in.c
--- a/sys/netinet/in.c Fri Apr 28 02:29:38 2017 +0000
+++ b/sys/netinet/in.c Fri Apr 28 05:56:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in.c,v 1.199 2017/03/17 17:26:20 roy Exp $ */
+/* $NetBSD: in.c,v 1.200 2017/04/28 05:56:33 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.199 2017/03/17 17:26:20 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.200 2017/04/28 05:56:33 ozaki-r Exp $");
#include "arp.h"
@@ -2077,16 +2077,24 @@
lle = in_lltable_find_dst(llt, sin->sin_addr);
if (lle == NULL) {
-#ifdef DIAGNOSTIC
- log(LOG_INFO, "interface address is missing from cache = %p in delete\n", lle);
+#ifdef DEBUG
+ char buf[64];
+ sockaddr_format(l3addr, buf, sizeof(buf));
+ log(LOG_INFO, "%s: cache for %s is not found\n",
+ __func__, buf);
#endif
return (ENOENT);
}
LLE_WLOCK(lle);
lle->la_flags |= LLE_DELETED;
-#ifdef DIAGNOSTIC
- log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle);
+#ifdef DEBUG
+ {
+ char buf[64];
+ sockaddr_format(l3addr, buf, sizeof(buf));
+ log(LOG_INFO, "%s: cache for %s (%p) is deleted\n",
+ __func__, buf, lle);
+ }
#endif
if ((lle->la_flags & (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC)
llentry_free(lle);
diff -r f8ef1f112273 -r c59ad2b94097 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c Fri Apr 28 02:29:38 2017 +0000
+++ b/sys/netinet6/in6.c Fri Apr 28 05:56:33 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.c,v 1.244 2017/03/02 09:48:20 ozaki-r Exp $ */
+/* $NetBSD: in6.c,v 1.245 2017/04/28 05:56:33 ozaki-r Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.244 2017/03/02 09:48:20 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.245 2017/04/28 05:56:33 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -2550,13 +2550,25 @@
lle = in6_lltable_find_dst(llt, &sin6->sin6_addr);
- if (lle == NULL)
+ if (lle == NULL) {
+#ifdef DEBUG
+ char buf[64];
+ sockaddr_format(l3addr, buf, sizeof(buf));
+ log(LOG_INFO, "%s: cache for %s is not found\n",
+ __func__, buf);
+#endif
return ENOENT;
+ }
LLE_WLOCK(lle);
lle->la_flags |= LLE_DELETED;
-#ifdef DIAGNOSTIC
- log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle);
+#ifdef DEBUG
+ {
+ char buf[64];
+ sockaddr_format(l3addr, buf, sizeof(buf));
+ log(LOG_INFO, "%s: cache for %s (%p) is deleted\n",
+ __func__, buf, lle);
+ }
#endif
if ((lle->la_flags & (LLE_STATIC | LLE_IFADDR)) == LLE_STATIC)
llentry_free(lle);
Home |
Main Index |
Thread Index |
Old Index