Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 May 2000 10:06:11 +0900
From:      itojun@iijlab.net
To:        Archie Cobbs <archie@whistle.com>
Cc:        freebsd-net@FreeBSD.ORG
Subject:   Re: BPF fix to if_loop.c
Message-ID:  <4814.959735171@coconut.itojun.org>
In-Reply-To: archie's message of Tue, 30 May 2000 14:55:26 MST. <200005302155.OAA00803@bubba.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>> 	sorry this was incorrect.  however, I think there should be check
>> 	if ifp really wants DLT_NULL encapsulation or not.
>Hmm.. maybe a better fix is to remove this BPF section altogether.. ?
>It's only going to result in showing the same packet twice, right?

	there are couple of different stories here.
	note that you can pass any ifp to if_simloop().

	a. when if_simloop(ifp = lo0), there must be call to bpf_mtap,
	   with DLT_NULL encapsulation.  if we don't do it here, nobody will.
	b. when if_simloop(ifp = non-lo0), there are two cases.
		b1. if it was called from layer 2 specific code like
		  if_ethersubr.c, if_simloop may want to inject the packet
		  with no encapsulation change.
		b2. if it was called from ip{6,}_mloopback, if_simloop() must
		  not call bpf_mtap.  with the current code, ifp_simloop
		  injects packet as is (with no layer 2 header) into, for
		  example to bpf for ethernet interface, passing junk to bpf
		  listeners.  this is the problem I experienced.

	in case of b1, your description should be correct (seeing same
	packet twice).  in case of b2, I'm still not sure how to resolve it.
	maybe I don't get the ultimate goal for this change from 4.4BSD.

itojun


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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