Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 print more diag message on in6_addmulti() failu...



details:   https://anonhg.NetBSD.org/src/rev/ca3895ff9f02
branches:  trunk
changeset: 510256:ca3895ff9f02
user:      itojun <itojun%NetBSD.org@localhost>
date:      Thu May 24 08:17:22 2001 +0000

description:
print more diag message on in6_addmulti() failures.

diffstat:

 sys/netinet6/in6_ifattach.c |  22 ++++++++++++++++++----
 sys/netinet6/nd6.c          |  12 +++++++-----
 sys/netinet6/nd6_rtr.c      |   7 +++++--
 3 files changed, 30 insertions(+), 11 deletions(-)

diffs (97 lines):

diff -r c348b1c8e42f -r ca3895ff9f02 sys/netinet6/in6_ifattach.c
--- a/sys/netinet6/in6_ifattach.c       Thu May 24 08:12:28 2001 +0000
+++ b/sys/netinet6/in6_ifattach.c       Thu May 24 08:17:22 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_ifattach.c,v 1.35 2001/04/13 23:30:25 thorpej Exp $        */
+/*     $NetBSD: in6_ifattach.c,v 1.36 2001/05/24 08:17:22 itojun Exp $ */
 /*     $KAME: in6_ifattach.c,v 1.100 2001/02/07 08:25:45 itojun Exp $  */
 
 /*
@@ -434,7 +434,10 @@
                llsol.s6_addr32[2] = htonl(1);
                llsol.s6_addr32[3] = ia->ia_addr.sin6_addr.s6_addr32[3];
                llsol.s6_addr8[12] = 0xff;
-               (void)in6_addmulti(&llsol, ifp, &error);
+               if (!in6_addmulti(&llsol, ifp, &error)) {
+                       nd6log((LOG_ERR, "%s: failed to join %s (errno=%d)\n",
+                           if_name(ifp), ip6_sprintf(&llsol), error));
+               }
 
                /* XXX should we run DAD on other interface types? */
                switch (ifp->if_type) {
@@ -736,7 +739,12 @@
                                  (struct sockaddr *)&mltmask,
                                  RTF_UP|RTF_CLONING,  /* xxx */
                                  (struct rtentry **)0);
-                       (void)in6_addmulti(&mltaddr.sin6_addr, ifp, &error);
+                       if (!in6_addmulti(&mltaddr.sin6_addr, ifp, &error)) {
+                               nd6log((LOG_ERR, "%s: failed to join %s "
+                                   "(errno=%d)\n", if_name(ifp),
+                                   ip6_sprintf(&mltaddr.sin6_addr),
+                                   error));
+                       }
                }
 
                if (ifp->if_flags & IFF_LOOPBACK) {
@@ -755,7 +763,13 @@
                                          (struct sockaddr *)&mltmask,
                                          RTF_UP,
                                          (struct rtentry **)0);
-                               (void)in6_addmulti(&mltaddr.sin6_addr, ifp, &error);
+                               if (!in6_addmulti(&mltaddr.sin6_addr, ifp,
+                                   &error)) {
+                                       nd6log((LOG_ERR, "%s: failed to join "
+                                           "%s (errno=%d)\n", if_name(ifp),
+                                           ip6_sprintf(&mltaddr.sin6_addr),
+                                           error));
+                               }
                        }
                }
        }
diff -r c348b1c8e42f -r ca3895ff9f02 sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c        Thu May 24 08:12:28 2001 +0000
+++ b/sys/netinet6/nd6.c        Thu May 24 08:17:22 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6.c,v 1.45 2001/03/30 11:08:58 itojun Exp $  */
+/*     $NetBSD: nd6.c,v 1.46 2001/05/24 08:17:22 itojun Exp $  */
 /*     $KAME: nd6.c,v 1.137 2001/03/21 21:52:06 jinmei Exp $   */
 
 /*
@@ -1216,10 +1216,12 @@
                                llsol.s6_addr32[2] = htonl(1);
                                llsol.s6_addr8[12] = 0xff;
 
-                               (void)in6_addmulti(&llsol, ifp, &error);
-                               if (error)
-                                       printf(
-"nd6_rtrequest: could not join solicited node multicast (errno=%d)\n", error);
+                               if (!in6_addmulti(&llsol, ifp, &error)) {
+                                       nd6log((LOG_ERR, "%s: "
+                                           "failed to join %s (errno=%d)\n",
+                                           if_name(ifp), ip6_sprintf(&llsol),
+                                           error));
+                               }
                        }
                }
                break;
diff -r c348b1c8e42f -r ca3895ff9f02 sys/netinet6/nd6_rtr.c
--- a/sys/netinet6/nd6_rtr.c    Thu May 24 08:12:28 2001 +0000
+++ b/sys/netinet6/nd6_rtr.c    Thu May 24 08:17:22 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nd6_rtr.c,v 1.23 2001/04/13 23:30:27 thorpej Exp $     */
+/*     $NetBSD: nd6_rtr.c,v 1.24 2001/05/24 08:17:22 itojun Exp $      */
 /*     $KAME: nd6_rtr.c,v 1.95 2001/02/07 08:09:47 itojun Exp $        */
 
 /*
@@ -1337,7 +1337,10 @@
                sol6.s6_addr32[2] = htonl(1);
                sol6.s6_addr32[3] = ia->ia_addr.sin6_addr.s6_addr32[3];
                sol6.s6_addr8[12] = 0xff;
-               (void)in6_addmulti(&sol6, ifp, &error);
+               if (!in6_addmulti(&sol6, ifp, &error)) {
+                       nd6log((LOG_ERR, "%s: failed to join %s (errno=%d)\n",
+                           if_name(ifp), ip6_sprintf(&sol6), error));
+               }
        }
 
        ia->ia6_flags |= IN6_IFF_TENTATIVE;



Home | Main Index | Thread Index | Old Index