summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf_jitter.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2009-11-18 19:26:17 +0000
committerjkim <jkim@FreeBSD.org>2009-11-18 19:26:17 +0000
commitefc247aeb32656ef1e27f5c3451d1fa4b1408294 (patch)
treea3a08f20079f4675a52c1823f3e5a1d17ffd253f /sys/net/bpf_jitter.c
parentf62107b530c25a7f2366b1bab84bbfe75bde02ed (diff)
downloadFreeBSD-src-efc247aeb32656ef1e27f5c3451d1fa4b1408294.zip
FreeBSD-src-efc247aeb32656ef1e27f5c3451d1fa4b1408294.tar.gz
- Make BPF JIT compiler working again in userland. We are limiting size of
generated native binary to page size for now. - Update copyright date and fix some style nits.
Diffstat (limited to 'sys/net/bpf_jitter.c')
-rw-r--r--sys/net/bpf_jitter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/bpf_jitter.c b/sys/net/bpf_jitter.c
index cb644f4..97f96a8 100644
--- a/sys/net/bpf_jitter.c
+++ b/sys/net/bpf_jitter.c
@@ -1,6 +1,6 @@
/*-
* Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy)
- * Copyright (C) 2005-2008 Jung-uk Kim <jkim@FreeBSD.org>
+ * Copyright (C) 2005-2009 Jung-uk Kim <jkim@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$");
#else
#include <stdlib.h>
#include <string.h>
+#include <sys/mman.h>
+#include <sys/param.h>
#include <sys/types.h>
#endif
@@ -127,7 +129,7 @@ bpf_destroy_jit_filter(bpf_jit_filter *filter)
{
if (filter->func != bpf_jit_accept_all)
- free(filter->func);
+ munmap(filter->func, BPF_JIT_MAXSIZE);
free(filter);
}
#endif
OpenPOWER on IntegriCloud