diff options
author | gallatin <gallatin@FreeBSD.org> | 2007-06-08 12:43:25 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2007-06-08 12:43:25 +0000 |
commit | 4e13491ecfab3a9c18fc7c0964b49da99478d39b (patch) | |
tree | 373383a903ff20fc1e97fdaabdfa1eb57361e404 /sys/net/pfil.h | |
parent | 9eba2904d11ed785ef1cc694b8615aeb353c2252 (diff) | |
download | FreeBSD-src-4e13491ecfab3a9c18fc7c0964b49da99478d39b.zip FreeBSD-src-4e13491ecfab3a9c18fc7c0964b49da99478d39b.tar.gz |
Correct the definition of PFIL_HOOKED() so that it compares
the value of ph_nhooks to zero, not the address. This removes
extranious calls to pfil_run_hooks (and an rw lock) from the
network stack's critical path when no pfil hooks are active.
Reviewed by: csjp
Sponsored by: Myricom Inc.
Diffstat (limited to 'sys/net/pfil.h')
-rw-r--r-- | sys/net/pfil.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/pfil.h b/sys/net/pfil.h index 6b00e5c..d2308fd 100644 --- a/sys/net/pfil.h +++ b/sys/net/pfil.h @@ -92,7 +92,7 @@ int pfil_head_unregister(struct pfil_head *); struct pfil_head *pfil_head_get(int, u_long); -#define PFIL_HOOKED(p) (&(p)->ph_nhooks > 0) +#define PFIL_HOOKED(p) ((p)->ph_nhooks > 0) #define PFIL_RLOCK(p) rw_rlock(&(p)->ph_mtx) #define PFIL_WLOCK(p) rw_wlock(&(p)->ph_mtx) #define PFIL_RUNLOCK(p) rw_runlock(&(p)->ph_mtx) |