summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2002-10-21 03:41:58 +0000
committerbrooks <brooks@FreeBSD.org>2002-10-21 03:41:58 +0000
commit6d2852e4eb7fb2e0b6a73ee0e8b70e46d6cc6d19 (patch)
tree862a1b973abbf7269ec6cda1d0b28707423d014e
parent3e43beb8f3f6e575656036250eaa8a25765f7d86 (diff)
downloadFreeBSD-src-6d2852e4eb7fb2e0b6a73ee0e8b70e46d6cc6d19.zip
FreeBSD-src-6d2852e4eb7fb2e0b6a73ee0e8b70e46d6cc6d19.tar.gz
Use if_printf(ifp, "blah") instead of printf("ppp%d: blah", ifp->if_unit).
-rw-r--r--sys/net/ppp_tty.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index be3ec82..ce05012 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -851,15 +851,14 @@ pppinput(c, tp)
if ((tp->t_state & TS_CONNECTED) == 0) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: no carrier\n", sc->sc_if.if_unit);
+ if_printf(&sc->sc_if, "no carrier\n");
goto flush;
}
if (c & TTY_ERRORMASK) {
/* framing error or overrun on this char - abort packet */
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: line error %x\n", sc->sc_if.if_unit,
- c & TTY_ERRORMASK);
+ if_printf(&sc->sc_if, "line error %x\n", c & TTY_ERRORMASK);
goto flush;
}
@@ -915,8 +914,8 @@ pppinput(c, tp)
sc->sc_flags |= SC_PKTLOST; /* note the dropped packet */
if ((sc->sc_flags & (SC_FLUSH | SC_ESCAPED)) == 0){
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: bad fcs %x, pkt len %d\n",
- sc->sc_if.if_unit, sc->sc_fcs, ilen);
+ if_printf(&sc->sc_if, "bad fcs %x, pkt len %d\n",
+ sc->sc_fcs, ilen);
sc->sc_if.if_ierrors++;
sc->sc_stats.ppp_ierrors++;
} else
@@ -928,7 +927,7 @@ pppinput(c, tp)
if (ilen < PPP_HDRLEN + PPP_FCSLEN) {
if (ilen) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: too short (%d)\n", sc->sc_if.if_unit, ilen);
+ if_printf(&sc->sc_if, "too short (%d)\n", ilen);
s = spltty();
sc->sc_if.if_ierrors++;
sc->sc_stats.ppp_ierrors++;
@@ -1000,7 +999,7 @@ pppinput(c, tp)
pppgetm(sc);
if (sc->sc_m == NULL) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: no input mbufs!\n", sc->sc_if.if_unit);
+ if_printf(&sc->sc_if, "no input mbufs!\n");
goto flush;
}
}
@@ -1013,8 +1012,8 @@ pppinput(c, tp)
if (c != PPP_ALLSTATIONS) {
if (sc->sc_flags & SC_REJ_COMP_AC) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: garbage received: 0x%x (need 0xFF)\n",
- sc->sc_if.if_unit, c);
+ if_printf(&sc->sc_if,
+ "garbage received: 0x%x (need 0xFF)\n", c);
goto flush;
}
*sc->sc_mp++ = PPP_ALLSTATIONS;
@@ -1025,8 +1024,7 @@ pppinput(c, tp)
}
if (sc->sc_ilen == 1 && c != PPP_UI) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: missing UI (0x3), got 0x%x\n",
- sc->sc_if.if_unit, c);
+ if_printf(&sc->sc_if, "missing UI (0x3), got 0x%x\n", c);
goto flush;
}
if (sc->sc_ilen == 2 && (c & 1) == 1) {
@@ -1037,15 +1035,15 @@ pppinput(c, tp)
}
if (sc->sc_ilen == 3 && (c & 1) == 0) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: bad protocol %x\n", sc->sc_if.if_unit,
- (sc->sc_mp[-1] << 8) + c);
+ if_printf(&sc->sc_if, "bad protocol %x\n",
+ (sc->sc_mp[-1] << 8) + c);
goto flush;
}
/* packet beyond configured mru? */
if (++sc->sc_ilen > sc->sc_mru + PPP_HDRLEN + PPP_FCSLEN) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: packet too big\n", sc->sc_if.if_unit);
+ if_printf(&sc->sc_if, "packet too big\n");
goto flush;
}
@@ -1056,7 +1054,7 @@ pppinput(c, tp)
pppgetm(sc);
if (m->m_next == NULL) {
if (sc->sc_flags & SC_DEBUG)
- printf("ppp%d: too few input mbufs!\n", sc->sc_if.if_unit);
+ if_printf(&sc->sc_if, "too few input mbufs!\n");
goto flush;
}
}
OpenPOWER on IntegriCloud