Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Nov 2019 23:21:47 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355070 - head/sys/net
Message-ID:  <201911242321.xAONLlm8038986@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Sun Nov 24 23:21:47 2019
New Revision: 355070
URL: https://svnweb.freebsd.org/changeset/base/355070

Log:
  Allow kernel to compile without BPF.
  
  r297816 added some bpf magic for VIMAGE unconditionally which no longer
  allows kernels to compile without bpf (but with other networking).
  Add the missing ifdef checks and allow a kernel to compile without bpf
  again.
  
  PR:		242136
  Reported by:	dave mischler.com
  MFC after:	2 weeks

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Sun Nov 24 21:08:56 2019	(r355069)
+++ head/sys/net/if.c	Sun Nov 24 23:21:47 2019	(r355070)
@@ -32,6 +32,7 @@
  * $FreeBSD$
  */
 
+#include "opt_bpf.h"
 #include "opt_inet6.h"
 #include "opt_inet.h"
 
@@ -1260,16 +1261,20 @@ static void
 if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
 {
 	struct if_clone *ifc;
+#ifdef DEV_BPF
 	u_int bif_dlt, bif_hdrlen;
+#endif
 	void *old;
 	int rc;
 
+#ifdef DEV_BPF
  	/*
 	 * if_detach_internal() will call the eventhandler to notify
 	 * interface departure.  That will detach if_bpf.  We need to
 	 * safe the dlt and hdrlen so we can re-attach it later.
 	 */
 	bpf_get_bp_params(ifp->if_bpf, &bif_dlt, &bif_hdrlen);
+#endif
 
 	/*
 	 * Detach from current vnet, but preserve LLADDR info, do not
@@ -1316,8 +1321,10 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet)
 
 	if_attach_internal(ifp, 1, ifc);
 
+#ifdef DEV_BPF
 	if (ifp->if_bpf == NULL)
 		bpfattach(ifp, bif_dlt, bif_hdrlen);
+#endif
 
 	CURVNET_RESTORE();
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911242321.xAONLlm8038986>