Avoid noise from the kernel if we have pseudo-device pppoe configured

but not used and a userland PPPoE pkg sends/receives PPPoE packets.
This commit is contained in:
martin 2002-03-04 15:15:05 +00:00
parent bf79729e2e
commit b94047688f
1 changed files with 13 additions and 8 deletions

View File

@ -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 <sys/cdefs.h>
__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);
}