Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 silence some of log(), as the codepath will be ...



details:   https://anonhg.NetBSD.org/src/rev/80bea6667b25
branches:  trunk
changeset: 532622:80bea6667b25
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Jun 11 07:28:05 2002 +0000

description:
silence some of log(), as the codepath will be visited for IPv6-non-capable
interfaces too and can be annoying.  net.inet6.icmp6.nd6_debug will
re-enable them.

diffstat:

 sys/netinet6/in6.c          |  40 ++++++++++++++++++++--------------------
 sys/netinet6/in6_ifattach.c |  22 +++++++++++++---------
 2 files changed, 33 insertions(+), 29 deletions(-)

diffs (195 lines):

diff -r 78a8641f39c7 -r 80bea6667b25 sys/netinet6/in6.c
--- a/sys/netinet6/in6.c        Tue Jun 11 07:17:15 2002 +0000
+++ b/sys/netinet6/in6.c        Tue Jun 11 07:28:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6.c,v 1.66 2002/06/09 14:43:11 itojun Exp $  */
+/*     $NetBSD: in6.c,v 1.67 2002/06/11 07:28:05 itojun Exp $  */
 /*     $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $   */
 
 /*
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.66 2002/06/09 14:43:11 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.67 2002/06/11 07:28:05 itojun Exp $");
 
 #include "opt_inet.h"
 
@@ -886,13 +886,13 @@
 
                if ((ifp->if_flags & (IFF_POINTOPOINT|IFF_LOOPBACK)) == 0) {
                        /* XXX: noisy message */
-                       log(LOG_INFO, "in6_update_ifa: a destination can be "
-                           "specified for a p2p or a loopback IF only\n");
+                       nd6log((LOG_INFO, "in6_update_ifa: a destination can be "
+                           "specified for a p2p or a loopback IF only\n"));
                        return(EINVAL);
                }
                if (plen != 128) {
-                       log(LOG_INFO, "in6_update_ifa: prefixlen should be "
-                           "128 when dstaddr is specified\n");
+                       nd6log((LOG_INFO, "in6_update_ifa: prefixlen should be "
+                           "128 when dstaddr is specified\n"));
 #ifdef FORCE_P2PPLEN
                        /*
                         * To be compatible with old configurations,
@@ -920,9 +920,9 @@
                 * the following log might be noisy, but this is a typical
                 * configuration mistake or a tool's bug.
                 */
-               log(LOG_INFO,
+               nd6log((LOG_INFO,
                    "in6_update_ifa: valid lifetime is 0 for %s\n",
-                   ip6_sprintf(&ifra->ifra_addr.sin6_addr));
+                   ip6_sprintf(&ifra->ifra_addr.sin6_addr)));
 
                if (ia == NULL)
                        return(0); /* there's nothing to do */
@@ -989,9 +989,9 @@
                 */
                if (ia->ia_prefixmask.sin6_len &&
                    in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL) != plen) {
-                       log(LOG_INFO, "in6_update_ifa: the prefix length of an"
+                       nd6log((LOG_INFO, "in6_update_ifa: the prefix length of an"
                            " existing (%s) address should not be changed\n",
-                           ip6_sprintf(&ia->ia_addr.sin6_addr));
+                           ip6_sprintf(&ia->ia_addr.sin6_addr)));
                        error = EINVAL;
                        goto unlink;
                }
@@ -1009,9 +1009,9 @@
 
                if ((ia->ia_flags & IFA_ROUTE) != 0 &&
                    (e = rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST)) != 0) {
-                       log(LOG_ERR, "in6_update_ifa: failed to remove "
+                       nd6log((LOG_ERR, "in6_update_ifa: failed to remove "
                            "a route to the old destination: %s\n",
-                           ip6_sprintf(&ia->ia_addr.sin6_addr));
+                           ip6_sprintf(&ia->ia_addr.sin6_addr)));
                        /* proceed anyway... */
                } else
                        ia->ia_flags &= ~IFA_ROUTE;
@@ -1079,10 +1079,10 @@
                                LIST_INSERT_HEAD(&ia->ia6_memberships, imm,
                                    i6mm_chain);
                        } else {
-                               log(LOG_ERR, "in6_update_ifa: addmulti "
+                               nd6log((LOG_ERR, "in6_update_ifa: addmulti "
                                    "failed for %s on %s (errno=%d)\n",
                                    ip6_sprintf(&llsol.sin6_addr),
-                                   if_name(ifp), error);
+                                   if_name(ifp), error));
                                goto cleanup;
                        }
                }
@@ -1147,11 +1147,11 @@
                        LIST_INSERT_HEAD(&ia->ia6_memberships, imm,
                            i6mm_chain);
                } else {
-                       log(LOG_WARNING,
+                       nd6log((LOG_WARNING,
                            "in6_update_ifa: addmulti failed for "
                            "%s on %s (errno=%d)\n",
                            ip6_sprintf(&mltaddr.sin6_addr),
-                           if_name(ifp), error);
+                           if_name(ifp), error));
                        goto cleanup;
                }
 
@@ -1164,10 +1164,10 @@
                                LIST_INSERT_HEAD(&ia->ia6_memberships, imm,
                                    i6mm_chain);
                        } else {
-                               log(LOG_WARNING, "in6_update_ifa: "
+                               nd6log((LOG_WARNING, "in6_update_ifa: "
                                    "addmulti failed for %s on %s (errno=%d)\n",
                                    ip6_sprintf(&mltaddr.sin6_addr),
-                                   if_name(ifp), error);
+                                   if_name(ifp), error));
                                /* XXX not very fatal, go on... */
                        }
                }
@@ -1213,11 +1213,11 @@
                                LIST_INSERT_HEAD(&ia->ia6_memberships, imm,
                                    i6mm_chain);
                        } else {
-                               log(LOG_WARNING, "in6_update_ifa: "
+                               nd6log((LOG_WARNING, "in6_update_ifa: "
                                    "addmulti failed for %s on %s "
                                    "(errno=%d)\n",
                                    ip6_sprintf(&mltaddr.sin6_addr),
-                                   if_name(ifp), error);
+                                   if_name(ifp), error));
                                goto cleanup;
                        }
                }
diff -r 78a8641f39c7 -r 80bea6667b25 sys/netinet6/in6_ifattach.c
--- a/sys/netinet6/in6_ifattach.c       Tue Jun 11 07:17:15 2002 +0000
+++ b/sys/netinet6/in6_ifattach.c       Tue Jun 11 07:28:05 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_ifattach.c,v 1.48 2002/06/08 21:22:31 itojun Exp $ */
+/*     $NetBSD: in6_ifattach.c,v 1.49 2002/06/11 07:28:06 itojun Exp $ */
 /*     $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.48 2002/06/08 21:22:31 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_ifattach.c,v 1.49 2002/06/11 07:28:06 itojun Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -391,10 +391,10 @@
                 * suppress it.  (jinmei%kame.net@localhost 20010130)
                 */
                if (error != EAFNOSUPPORT)
-                       log(LOG_NOTICE, "in6_ifattach_linklocal: failed to "
+                       nd6log((LOG_NOTICE, "in6_ifattach_linklocal: failed to "
                            "configure a link-local address on %s "
                            "(errno=%d)\n",
-                           if_name(ifp), error);
+                           if_name(ifp), error));
                return(-1);
        }
 
@@ -499,9 +499,9 @@
         * NULL to the 3rd arg.
         */
        if ((error = in6_update_ifa(ifp, &ifra, NULL)) != 0) {
-               log(LOG_ERR, "in6_ifattach_loopback: failed to configure "
+               nd6log((LOG_ERR, "in6_ifattach_loopback: failed to configure "
                    "the loopback address on %s (errno=%d)\n",
-                   if_name(ifp), error);
+                   if_name(ifp), error));
                return(-1);
        }
 
@@ -587,8 +587,12 @@
         * remember there could be some link-layer that has special
         * fragmentation logic.
         */
-       if (ifp->if_mtu < IPV6_MMTU)
+       if (ifp->if_mtu < IPV6_MMTU) {
+               nd6log((LOG_INFO, "in6_ifattach: "
+                   "%s has too small MTU, IPv6 not enabled\n",
+                   if_name(ifp)));
                return;
+       }
 
        /* create a multicast kludge storage (if we have not had one) */
        in6_createmkludge(ifp);
@@ -615,9 +619,9 @@
         * usually, we require multicast capability to the interface
         */
        if ((ifp->if_flags & IFF_MULTICAST) == 0) {
-               log(LOG_INFO, "in6_ifattach: "
+               nd6log((LOG_INFO, "in6_ifattach: "
                    "%s is not multicast capable, IPv6 not enabled\n",
-                   if_name(ifp));
+                   if_name(ifp)));
                return;
        }
 



Home | Main Index | Thread Index | Old Index