Don't output debugging logs just if DIAGNOSTIC

Also make log messages informative.
This commit is contained in:
ozaki-r 2017-04-28 05:56:33 +00:00
parent 739249e751
commit c33d80e3e4
2 changed files with 31 additions and 11 deletions

View File

@ -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 @@ in_lltable_delete(struct lltable *llt, u_int flags,
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);

View File

@ -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 @@ in6_lltable_delete(struct lltable *llt, u_int flags,
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);