Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 Clean up some printfs(), and mark a few for pos...



details:   https://anonhg.NetBSD.org/src/rev/0faa01fced07
branches:  trunk
changeset: 474533:0faa01fced07
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jul 10 19:46:10 1999 +0000

description:
Clean up some printfs(), and mark a few for possible later nuking,
since they appear to be for debugging purposes only.

diffstat:

 sys/netinet6/in6_ifattach.c |  31 +++++++++++++++++++------------
 sys/netinet6/nd6_nbr.c      |  31 ++++++++++++++++++-------------
 2 files changed, 37 insertions(+), 25 deletions(-)

diffs (169 lines):

diff -r 623cb9986f1f -r 0faa01fced07 sys/netinet6/in6_ifattach.c
--- a/sys/netinet6/in6_ifattach.c       Sat Jul 10 19:41:15 1999 +0000
+++ b/sys/netinet6/in6_ifattach.c       Sat Jul 10 19:46:10 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_ifattach.c,v 1.3 1999/07/03 21:30:18 thorpej Exp $ */
+/*     $NetBSD: in6_ifattach.c,v 1.4 1999/07/10 19:46:10 thorpej Exp $ */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -122,7 +122,9 @@
                        }
                }
        }
-       printf("failed to get EUI64");
+#ifdef DEBUG
+       printf("in6_ifattach_getifid: failed to get EUI64");
+#endif
        return EADDRNOTAVAIL;
 
 found:
@@ -140,8 +142,8 @@
        }
 
        if (found_first_ifid) {
-               printf("got EUI64 from %s, "
-                       "value %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+               printf("%s: supplying EUI64: "
+                       "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
                        ifp->if_xname,
                        first_ifid[0] & 0xff, first_ifid[1] & 0xff,
                        first_ifid[2] & 0xff, first_ifid[3] & 0xff,
@@ -149,7 +151,9 @@
                        first_ifid[6] & 0xff, first_ifid[7] & 0xff);
                return 0;
        } else {
-               printf("failed to get EUI64");
+#ifdef DEBUG
+               printf("in6_ifattach_getifid: failed to get EUI64");
+#endif
                return EADDRNOTAVAIL;
        }
 }
@@ -164,7 +168,7 @@
        struct ifnet *ifp;
 
        /* prevent infinite loop. just in case. */
-       if (! found_first_ifid)
+       if (found_first_ifid == 0)
                return;
 
        for (ifp = ifnet.tqh_first; ifp; ifp = ifp->if_list.tqe_next) {
@@ -205,13 +209,13 @@
        int rtflag = 0;
 
        if (type == IN6_IFT_P2P && found_first_ifid == 0) {
-               printf("%s: no ifid available yet for IPv6 link-local address\n",
+               printf("%s: no ifid available for IPv6 link-local address\n",
                        ifp->if_xname);
                return;
        }
 
        if ((ifp->if_flags & IFF_MULTICAST) == 0) {
-               printf("%s: no multicast allowed, IPv6 is not enabled\n",
+               printf("%s: not multicast capable, IPv6 not enabled\n",
                        ifp->if_xname);
                return;
        }
@@ -303,7 +307,7 @@
                ieee802_to_eui64(&ia->ia_addr.sin6_addr.s6_addr8[8], laddr);
                /* set global bit */
                ia->ia_addr.sin6_addr.s6_addr8[8] |= 0x02;
-               if (! found_first_ifid) {
+               if (found_first_ifid == 0) {
                        if (in6_ifattach_getifid(ifp) == 0)
                                in6_ifattach_p2p();
                }
@@ -332,11 +336,11 @@
                if (error) {
                        switch (error) {
                        case EAFNOSUPPORT:
-                               printf("%s: IPv6 is not supported\n",
+                               printf("%s: IPv6 not supported\n",
                                        ifp->if_xname);
                                break;
                        default:
-                               printf("SIOCSIFADDR(%s) returned %d\n",
+                               printf("%s: SIOCSIFADDR error %d\n",
                                        ifp->if_xname, error);
                                break;
                        }
@@ -559,8 +563,11 @@
                                ia = ia->ia_next;
                        if (ia->ia_next)
                                ia->ia_next = oia->ia_next;
+#ifdef DEBUG
                        else
-                               printf("Didn't unlink in6ifaddr from list\n");
+                               printf("%s: didn't unlink in6ifaddr from "
+                                   "list\n", ifp->if_xname);
+#endif
                }
 
                free(ia, M_IFADDR);
diff -r 623cb9986f1f -r 0faa01fced07 sys/netinet6/nd6_nbr.c
--- a/sys/netinet6/nd6_nbr.c    Sat Jul 10 19:41:15 1999 +0000
+++ b/sys/netinet6/nd6_nbr.c    Sat Jul 10 19:46:10 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6_nbr.c,v 1.5 1999/07/09 22:57:30 thorpej Exp $      */
+/*     $NetBSD: nd6_nbr.c,v 1.6 1999/07/10 19:46:10 thorpej Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -915,8 +915,9 @@
        bzero(dp, sizeof(*dp));
        TAILQ_INSERT_TAIL(&dadq, (struct dadq *)dp, dad_list);
 
-       printf("performing DAD for %s(%s)\n",
-               ip6_sprintf(&ia->ia_addr.sin6_addr), ifa->ifa_ifp->if_xname);
+       /* XXXJRT This is probably a purely debugging message. */
+       printf("%s: starting DAD for %s\n", ifa->ifa_ifp->if_xname,
+           ip6_sprintf(&ia->ia_addr.sin6_addr));
 
        /*
         * Send NS packet for DAD, ip6_dad_count times.
@@ -1060,9 +1061,11 @@
                         */
                        ia->ia6_flags &= ~IN6_IFF_TENTATIVE;
 
-                       printf("DAD success for %s(%s)\n",
-                               ip6_sprintf(&ia->ia_addr.sin6_addr),
-                               ifa->ifa_ifp->if_xname);
+                       /* XXXJRT This is probably a purely debugging message */
+                       printf("%s: DAD complete for %s - no duplicates "
+                           "found\n", ifa->ifa_ifp->if_xname,
+                           ip6_sprintf(&ia->ia_addr.sin6_addr));
+
                        TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
                        free(dp, M_IP6NDP);
                        dp = NULL;
@@ -1087,10 +1090,10 @@
                return;
        }
 
-       log(LOG_ERR, "DAD detected duplicate IP6 address %s(%s): "
-               "got %d NS and %d NA\n", ip6_sprintf(&ia->ia_addr.sin6_addr),
-               ifa->ifa_ifp->if_xname,
-               dp->dad_ns_icount, dp->dad_na_icount);
+       log(LOG_ERR, "%s: DAD detected duplicate IPv6 address %s: %d NS, "
+           "%d NA\n", ifa->ifa_ifp->if_xname,
+           ip6_sprintf(&ia->ia_addr.sin6_addr),
+           dp->dad_ns_icount, dp->dad_na_icount);
 
        ia->ia6_flags &= ~IN6_IFF_TENTATIVE;
        ia->ia6_flags |= IN6_IFF_DUPLICATED;
@@ -1102,9 +1105,11 @@
 #endif
                );
 
-       printf("DAD failed for %s(%s): manual operation required\n",
-               ip6_sprintf(&ia->ia_addr.sin6_addr),
-               ifa->ifa_ifp->if_xname);
+       /* XXXJRT This is probably a purely debugging message. */
+       printf("%s: DAD complete for %s - duplicate found\n",
+           ifa->ifa_ifp->if_xname, ip6_sprintf(&ia->ia_addr.sin6_addr));
+       printf("%s: manual intervention required\n", ifa->ifa_ifp->if_xname);
+
        TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list);
        free(dp, M_IP6NDP);
        dp = NULL;



Home | Main Index | Thread Index | Old Index