Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2008 15:09:00 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 137406 for review
Message-ID:  <200803111509.m2BF9051043782@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=137406

Change 137406 by rwatson@rwatson_cinnamon on 2008/03/11 15:08:32

	Embed the size of struct xbpf_d in the structure so that userspace
	can check that the run-time version is the same as the
	compile-time version.

Affected files ...

.. //depot/projects/zcopybpf/src/sys/net/bpf.c#49 edit
.. //depot/projects/zcopybpf/src/sys/net/bpfdesc.h#10 edit

Differences ...

==== //depot/projects/zcopybpf/src/sys/net/bpf.c#49 (text+ko) ====

@@ -1959,6 +1959,7 @@
 
 	bzero(d, sizeof(*d));
 	BPFD_LOCK_ASSERT(bd);
+	d->bd_structsize = sizeof(*d);
 	d->bd_immediate = bd->bd_immediate;
 	d->bd_promisc = bd->bd_promisc;
 	d->bd_hdrcmplt = bd->bd_hdrcmplt;

==== //depot/projects/zcopybpf/src/sys/net/bpfdesc.h#10 (text+ko) ====

@@ -114,6 +114,7 @@
  * External representation of the bpf descriptor
  */
 struct xbpf_d {
+	u_int		bd_structsize;	/* Size of this structure. */
 	u_char		bd_promisc;
 	u_char		bd_immediate;
 	int		bd_hdrcmplt;



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