Source-Changes-HG archive

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

[src/trunk]: src/sys/net Increase interface output error count in case of a f...



details:   https://anonhg.NetBSD.org/src/rev/d52dd3a9c550
branches:  trunk
changeset: 534364:d52dd3a9c550
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jul 23 06:59:51 2002 +0000

description:
Increase interface output error count in case of a failure.

diffstat:

 sys/net/if_stf.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (64 lines):

diff -r bb957b287c45 -r d52dd3a9c550 sys/net/if_stf.c
--- a/sys/net/if_stf.c  Tue Jul 23 06:53:35 2002 +0000
+++ b/sys/net/if_stf.c  Tue Jul 23 06:59:51 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_stf.c,v 1.25 2002/07/23 06:44:53 tron Exp $ */
+/*     $NetBSD: if_stf.c,v 1.26 2002/07/23 06:59:51 tron Exp $ */
 /*     $KAME: if_stf.c,v 1.62 2001/06/07 22:32:16 itojun Exp $ */
 
 /*
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.25 2002/07/23 06:44:53 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stf.c,v 1.26 2002/07/23 06:59:51 tron Exp $");
 
 #include "opt_inet.h"
 
@@ -366,13 +366,16 @@
        ia6 = stf_getsrcifa6(ifp);
        if (ia6 == NULL) {
                m_freem(m);
+               ifp->if_oerrors++;
                return ENETDOWN;
        }
 
        if (m->m_len < sizeof(*ip6)) {
                m = m_pullup(m, sizeof(*ip6));
-               if (!m)
+               if (m == NULL) {
+                       ifp->if_oerrors++;
                        return ENOBUFS;
+               }
        }
        ip6 = mtod(m, struct ip6_hdr *);
        tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
@@ -387,6 +390,7 @@
                in4 = GET_V4(&dst6->sin6_addr);
        else {
                m_freem(m);
+               ifp->if_oerrors++;
                return ENETUNREACH;
        }
 
@@ -417,8 +421,10 @@
        M_PREPEND(m, sizeof(struct ip), M_DONTWAIT);
        if (m && m->m_len < sizeof(struct ip))
                m = m_pullup(m, sizeof(struct ip));
-       if (m == NULL)
+       if (m == NULL) {
+               ifp->if_oerrors++;
                return ENOBUFS;
+       }
        ip = mtod(m, struct ip *);
 
        memset(ip, 0, sizeof(*ip));
@@ -451,6 +457,7 @@
                rtalloc(&sc->sc_ro);
                if (sc->sc_ro.ro_rt == NULL) {
                        m_freem(m);
+                       ifp->if_oerrors++;
                        return ENETUNREACH;
                }
        }



Home | Main Index | Thread Index | Old Index