Source-Changes-HG archive

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

[src/trunk]: src/sys/net Avoid any non-error output for normal operations, on...



details:   https://anonhg.NetBSD.org/src/rev/b8374e4e3feb
branches:  trunk
changeset: 521535:b8374e4e3feb
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Feb 01 13:50:00 2002 +0000

description:
Avoid any non-error output for normal operations, only print those
messages if the interface is set to debug.

diffstat:

 sys/net/if_pppoe.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r c619b31ee6fb -r b8374e4e3feb sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c        Fri Feb 01 13:40:16 2002 +0000
+++ b/sys/net/if_pppoe.c        Fri Feb 01 13:50:00 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.19 2002/02/01 13:40:16 martin Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.20 2002/02/01 13:50:00 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Martin Husemann. All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.19 2002/02/01 13:40:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.20 2002/02/01 13:50:00 martin Exp $");
 
 #include "pppoe.h"
 #include "bpfilter.h"
@@ -471,7 +471,8 @@
                        return;
                sc->sc_session = session;
                callout_stop(&sc->sc_timeout);
-               printf("%s: session 0x%x connected\n", sc->sc_sppp.pp_if.if_xname, session);
+               if (sc->sc_sppp.pp_if.if_flags & IFF_DEBUG)
+                       printf("%s: session 0x%x connected\n", sc->sc_sppp.pp_if.if_xname, session);
                sc->sc_state = PPPOE_STATE_SESSION;
                sc->sc_sppp.pp_up(&sc->sc_sppp);        /* notify upper layers */
                break;
@@ -480,8 +481,8 @@
                        return;
                 /* stop timer (we might be about to transmit a PADT ourself) */
                 callout_stop(&sc->sc_timeout);
-                /* signal upper layer */
-                printf("%s: session 0x%x terminated, received PADT\n", sc->sc_sppp.pp_if.if_xname, session);
+                if (sc->sc_sppp.pp_if.if_flags & IFF_DEBUG)
+                       printf("%s: session 0x%x terminated, received PADT\n", sc->sc_sppp.pp_if.if_xname, session);
                 /* clean up softc */
                 sc->sc_state = PPPOE_STATE_INITIAL;
                 memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest));
@@ -491,6 +492,7 @@
                 }
                 sc->sc_ac_cookie_len = 0;
                 sc->sc_session = 0;
+                /* signal upper layer */
                 sc->sc_sppp.pp_down(&sc->sc_sppp);
                 break;
         default:
@@ -894,7 +896,8 @@
        if (sc->sc_state < PPPOE_STATE_SESSION)
                err = EBUSY;
        else {
-               printf("%s: disconnecting\n", sc->sc_sppp.pp_if.if_xname);
+               if (sc->sc_sppp.pp_if.if_flags & IFF_DEBUG)
+                       printf("%s: disconnecting\n", sc->sc_sppp.pp_if.if_xname);
                err = pppoe_send_padt(sc);
        }
 



Home | Main Index | Thread Index | Old Index