summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-10-15 05:07:00 +0000
committermsmith <msmith@FreeBSD.org>1999-10-15 05:07:00 +0000
commit010a32d6458bd7e412e002c28e3878b4705e31d4 (patch)
treec7ec9ce93e079a077a5d74249290ab77984e574c /sys/net/bpf.c
parentd21234b78cc7e611247dffae6bf6c15ac69b667a (diff)
downloadFreeBSD-src-010a32d6458bd7e412e002c28e3878b4705e31d4.zip
FreeBSD-src-010a32d6458bd7e412e002c28e3878b4705e31d4.tar.gz
Implement pseudo_AF_HDRCMPLT, which controls the state of the 'header
completion' flag. If set, the interface output routine will assume that the packet already has a valid link-level source address. This defaults to off (the address is overwritten) PR: kern/10680 Submitted by: "Christopher N . Harrell" <cnh@mindspring.net> Obtained from: NetBSD
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r--sys/net/bpf.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 6876ab2..5bd8ed5 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -579,6 +579,9 @@ bpfwrite(dev, uio, ioflag)
if (datlen > ifp->if_mtu)
return (EMSGSIZE);
+ if (d->bd_hdrcmplt)
+ dst.sa_family = pseudo_AF_HDRCMPLT;
+
s = splnet();
#if BSD >= 199103
error = (*ifp->if_output)(ifp, m, &dst, (struct rtentry *)0);
@@ -626,6 +629,8 @@ reset_d(d)
* BIOCGSTATS Get packet stats.
* BIOCIMMEDIATE Set immediate mode.
* BIOCVERSION Get filter language version.
+ * BIOCGHDRCMPLT Get "header already complete" flag
+ * BIOCSHDRCMPLT Set "header already complete" flag
*/
/* ARGSUSED */
static int
@@ -822,6 +827,20 @@ bpfioctl(dev, cmd, addr, flags, p)
break;
}
+ /*
+ * Get "header already complete" flag
+ */
+ case BIOCGHDRCMPLT:
+ *(u_int *)addr = d->bd_hdrcmplt;
+ break;
+
+ /*
+ * Set "header already complete" flag
+ */
+ case BIOCSHDRCMPLT:
+ d->bd_hdrcmplt = *(u_int *)addr ? 1 : 0;
+ break;
+
case FIONBIO: /* Non-blocking I/O */
break;
OpenPOWER on IntegriCloud