From 95d6206a6c70299180be035b01a61e8044b2870c Mon Sep 17 00:00:00 2001 From: aymeric Date: Sun, 2 Mar 2003 10:50:14 +0000 Subject: [PATCH] ignore multicast PPPoE packets ASAP. This improves performance a lot on slow machines behind a cable modem. Protect it with PPPOE_SERVER as a reminder that this will have to be changed if we add PPPoE server code in the kernel one day. --- sys/net/if_ethersubr.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 1d14efbfe302..f89e1fbb5f15 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ethersubr.c,v 1.104 2003/02/26 06:31:12 matt Exp $ */ +/* $NetBSD: if_ethersubr.c,v 1.105 2003/03/02 10:50:14 aymeric Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.104 2003/02/26 06:31:12 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.105 2003/03/02 10:50:14 aymeric Exp $"); #include "opt_inet.h" #include "opt_atalk.h" @@ -802,6 +802,13 @@ ether_input(struct ifnet *ifp, struct mbuf *m) #if NPPPOE > 0 case ETHERTYPE_PPPOEDISC: case ETHERTYPE_PPPOE: +#ifndef PPPOE_SERVER + if (m->m_flags & (M_MCAST | M_BCAST)) { + m_freem(m); + return; + } +#endif + if (etype == ETHERTYPE_PPPOEDISC) inq = &ppoediscinq; else