-/* $OpenBSD: if.c,v 1.656 2022/06/28 09:41:24 jan Exp $ */
+/* $OpenBSD: if.c,v 1.657 2022/06/29 09:08:07 mvs Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
#include "pf.h"
#include "pfsync.h"
#include "ppp.h"
+#include "pppoe.h"
#include "if_wg.h"
#include <sys/param.h>
#ifdef PIPEX
if (n & (1 << NETISR_PIPEX))
pipexintr();
+#endif
+#if NPPPOE > 0
+ if (n & (1 << NETISR_PPPOE))
+ pppoeintr();
#endif
t |= n;
}
-/* $OpenBSD: if_ethersubr.c,v 1.283 2022/06/28 16:10:43 mvs Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.284 2022/06/29 09:08:07 mvs Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
}
}
#endif
- KERNEL_LOCK();
- if (etype == ETHERTYPE_PPPOEDISC)
- pppoe_disc_input(m);
- else
- pppoe_data_input(m);
- KERNEL_UNLOCK();
+ if (etype == ETHERTYPE_PPPOEDISC) {
+ if (mq_enqueue(&pppoediscinq, m) == 0)
+ schednetisr(NETISR_PPPOE);
+ } else {
+ if (mq_enqueue(&pppoeinq, m) == 0)
+ schednetisr(NETISR_PPPOE);
+ }
return;
#endif
#ifdef MPLS
-/* $OpenBSD: if_pppoe.c,v 1.80 2022/05/14 09:46:15 tobhe Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.81 2022/06/29 09:08:07 mvs Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
};
/* input routines */
+void pppoe_disc_input(struct mbuf *);
+void pppoe_data_input(struct mbuf *);
static void pppoe_dispatch_disc_pkt(struct mbuf *);
/* management routines */
struct if_clone pppoe_cloner =
IF_CLONE_INITIALIZER("pppoe", pppoe_clone_create, pppoe_clone_destroy);
+struct mbuf_queue pppoediscinq = MBUF_QUEUE_INITIALIZER(
+ IFQ_MAXLEN, IPL_SOFTNET);
+struct mbuf_queue pppoeinq = MBUF_QUEUE_INITIALIZER(
+ IFQ_MAXLEN, IPL_SOFTNET);
+
+void pppoeintr(void)
+{
+ struct mbuf_list ml;
+ struct mbuf *m;
+
+ NET_ASSERT_LOCKED();
+
+ mq_delist(&pppoediscinq, &ml);
+ while ((m = ml_dequeue(&ml)) != NULL)
+ pppoe_disc_input(m);
+
+ mq_delist(&pppoeinq, &ml);
+ while ((m = ml_dequeue(&ml)) != NULL)
+ pppoe_data_input(m);
+}
void
pppoeattach(int count)
-/* $OpenBSD: if_pppoe.h,v 1.7 2021/01/04 21:21:41 kn Exp $ */
+/* $OpenBSD: if_pppoe.h,v 1.8 2022/06/29 09:08:07 mvs Exp $ */
/* $NetBSD: if_pppoe.h,v 1.5 2003/11/28 08:56:48 keihan Exp $ */
/*
#ifdef _KERNEL
-void pppoe_disc_input(struct mbuf *);
-void pppoe_data_input(struct mbuf *);
+extern struct mbuf_queue pppoediscinq;
+extern struct mbuf_queue pppoeinq;
#endif /* _KERNEL */
#endif /* _NET_IF_PPPOE_H_ */
-/* $OpenBSD: netisr.h,v 1.57 2022/06/28 08:01:40 mvs Exp $ */
+/* $OpenBSD: netisr.h,v 1.58 2022/06/29 09:08:07 mvs Exp $ */
/* $NetBSD: netisr.h,v 1.12 1995/08/12 23:59:24 mycroft Exp $ */
/*
#define NETISR_PIPEX 27 /* for pipex processing */
#define NETISR_PPP 28 /* for PPP processing */
#define NETISR_BRIDGE 29 /* for bridge processing */
+#define NETISR_PPPOE 30 /* for pppoe processing */
#define NETISR_SWITCH 31 /* for switch dataplane */
#ifndef _LOCORE
void switchintr(void);
void pfsyncintr(void);
void pipexintr(void);
+void pppoeintr(void);
#define schednetisr(anisr) \
do { \