# contrib/tcpdump/print-pflog.c | 18 +++++++++++++++--- # sys/sys/vmmeter.h | 6 ++++-- # 2 files changed, 19 insertions(+), 5 deletions(-) # svn status M sys/sys/vmmeter.h M contrib/tcpdump/print-pflog.c Index: sys/sys/vmmeter.h =================================================================== --- sys/sys/vmmeter.h (revision 269977) +++ sys/sys/vmmeter.h (working copy) @@ -186,8 +186,10 @@ static __inline int vm_paging_needed(void) { - return (vm_cnt.v_free_count + vm_cnt.v_cache_count < - vm_pageout_wakeup_thresh); + int vm_pageout_cnt; + + vm_pageout_cnt = vm_cnt.v_free_count + vm_cnt.v_cache_count; + return (vm_pageout_cnt < vm_pageout_wakeup_thresh); } #endif Index: contrib/tcpdump/print-pflog.c =================================================================== --- contrib/tcpdump/print-pflog.c (revision 269977) +++ contrib/tcpdump/print-pflog.c (working copy) @@ -32,6 +32,11 @@ static const char rcsid[] _U_ = #error "No pf headers available" #endif #include +#include +#include +#define _KERNEL +#include +#undef _KERNEL #include #include #include @@ -101,12 +106,19 @@ pflog_print(const struct pfloghdr *hdr) printf("rule %u/", rulenr); else printf("rule %u.%s.%u/", rulenr, hdr->ruleset, subrulenr); - - printf("%s: %s %s on %s: ", - tok2str(pf_reasons, "unkn(%u)", hdr->reason), + printf("%s", tok2str(pf_reasons, "unkn(%u)", hdr->reason)); + if (vflag) + printf("[uid %u, pid %u]", (unsigned)hdr->rule_uid, + (unsigned)hdr->rule_pid); + printf(": %s %s on %s: ", tok2str(pf_actions, "unkn(%u)", hdr->action), tok2str(pf_directions, "unkn(%u)", hdr->dir), hdr->ifname); + if (vflag && hdr->uid != UID_MAX) + printf("[uid %u] ", (unsigned)hdr->uid); + if (vflag && hdr->pid != NO_PID) + printf("[pid %u] ", (unsigned)hdr->pid); + /* XXX: pid is not displayed as we always have NO_PID currently. */ } u_int