diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c index 11ec8fe69877..46f59fe82bfe 100644 --- a/sys/net/if_pppoe.c +++ b/sys/net/if_pppoe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_pppoe.c,v 1.22 2002/02/24 17:11:53 martin Exp $ */ +/* $NetBSD: if_pppoe.c,v 1.23 2002/03/04 15:15:05 martin Exp $ */ /* * Copyright (c) 2001 Martin Husemann. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.22 2002/02/24 17:11:53 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.23 2002/03/04 15:15:05 martin Exp $"); #include "pppoe.h" #include "bpfilter.h" @@ -443,7 +443,9 @@ static void pppoe_dispatch_disc_pkt(u_int8_t *p, size_t size, struct ifnet *rcvi return; case PPPOE_CODE_PADO: if (sc == NULL) { - printf("pppoe: received PADO but could not find request for it\n"); + /* be quiete if there is not a single pppoe instance */ + if (!LIST_EMPTY(&pppoe_softc_list)) + printf("pppoe: received PADO but could not find request for it\n"); return; } if (sc->sc_state != PPPOE_STATE_PADI_SENT) { @@ -509,11 +511,14 @@ pppoe_disc_input(struct mbuf *m) u_int8_t *p; struct ether_header *eh; - eh = mtod(m, struct ether_header*); - m_adj(m, sizeof(struct ether_header)); - p = mtod(m, u_int8_t*); - KASSERT(m->m_flags & M_PKTHDR); - pppoe_dispatch_disc_pkt(p, m->m_len, m->m_pkthdr.rcvif, eh); + /* avoid error messages if there is not a single pppoe instance */ + if (!LIST_EMPTY(&pppoe_softc_list)) { + eh = mtod(m, struct ether_header*); + m_adj(m, sizeof(struct ether_header)); + p = mtod(m, u_int8_t*); + KASSERT(m->m_flags & M_PKTHDR); + pppoe_dispatch_disc_pkt(p, m->m_len, m->m_pkthdr.rcvif, eh); + } m_free(m); }