-/* $OpenBSD: if.c,v 1.629 2021/02/11 20:28:01 mvs Exp $ */
+/* $OpenBSD: if.c,v 1.630 2021/02/20 01:11:43 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
}
#endif
- (*ifp->if_input)(ifp, m);
+ if (__predict_true(!ISSET(ifp->if_xflags, IFXF_MONITOR)))
+ (*ifp->if_input)(ifp, m);
}
void
-/* $OpenBSD: if.h,v 1.206 2021/02/01 07:43:33 mvs Exp $ */
+/* $OpenBSD: if.h,v 1.207 2021/02/20 01:11:44 dlg Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
#define IFXF_AUTOCONF6 0x20 /* [N] v6 autoconf enabled */
#define IFXF_INET6_NOSOII 0x40 /* [N] don't do RFC 7217 */
#define IFXF_AUTOCONF4 0x80 /* [N] v4 autoconf (aka dhcp) enabled */
+#define IFXF_MONITOR 0x100 /* [N] only used for bpf */
#define IFXF_CANTCHANGE \
(IFXF_MPSAFE|IFXF_CLONED)
-/* $OpenBSD: ifq.c,v 1.41 2020/07/07 00:00:03 dlg Exp $ */
+/* $OpenBSD: ifq.c,v 1.42 2021/02/20 01:11:44 dlg Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
ifiq->ifiq_bytes += bytes;
len = ml_len(&ifiq->ifiq_ml);
- if (len > ifiq_maxlen_drop)
- ifiq->ifiq_qdrops += ml_len(ml);
- else
- ml_enlist(&ifiq->ifiq_ml, ml);
+ if (__predict_true(!ISSET(ifp->if_xflags, IFXF_MONITOR))) {
+ if (len > ifiq_maxlen_drop)
+ ifiq->ifiq_qdrops += ml_len(ml);
+ else
+ ml_enlist(&ifiq->ifiq_ml, ml);
+ }
mtx_leave(&ifiq->ifiq_mtx);
if (ml_empty(ml))