From 8d13037cda75b92097a08f1faf22ee428c2d4cc7 Mon Sep 17 00:00:00 2001 From: Max Laier Date: Sun, 25 Dec 2005 22:57:08 +0000 Subject: [PATCH] Fix build after timeval.tv_sec changed from long to time_t. --- contrib/pf/authpf/authpf.c | 8 ++++++++ sys/contrib/pf/net/pf_norm.c | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/contrib/pf/authpf/authpf.c b/contrib/pf/authpf/authpf.c index af75027c4235..22fdfa426036 100644 --- a/contrib/pf/authpf/authpf.c +++ b/contrib/pf/authpf/authpf.c @@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -702,8 +705,13 @@ change_filter(int add, const char *luser, const char *ipsrc) syslog(LOG_INFO, "allowing %s, user %s", ipsrc, luser); } else { gettimeofday(&Tend, NULL); +#ifdef __FreeBSD__ + syslog(LOG_INFO, "removed %s, user %s - duration %jd seconds", + ipsrc, luser, (intmax_t)(Tend.tv_sec - Tstart.tv_sec)); +#else syslog(LOG_INFO, "removed %s, user %s - duration %ld seconds", ipsrc, luser, Tend.tv_sec - Tstart.tv_sec); +#endif } return (0); no_mem: diff --git a/sys/contrib/pf/net/pf_norm.c b/sys/contrib/pf/net/pf_norm.c index 34aea8434365..7312ecdf1510 100644 --- a/sys/contrib/pf/net/pf_norm.c +++ b/sys/contrib/pf/net/pf_norm.c @@ -75,6 +75,8 @@ #include #ifndef __FreeBSD__ +#include + struct pf_frent { LIST_ENTRY(pf_frent) fr_next; struct ip *fr_ip; @@ -1815,8 +1817,9 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd, SEQ_LT(tsecr, dst->scrub->pfss_tsval0)? '3' : ' ')); #ifdef __FreeBSD__ DPFPRINTF((" tsval: %u tsecr: %u +ticks: %u " - "idle: %lus %lums\n", - tsval, tsecr, tsval_from_last, delta_ts.tv_sec, + "idle: %jus %lums\n", + tsval, tsecr, tsval_from_last, + (uintmax_t)delta_ts.tv_sec, delta_ts.tv_usec / 1000)); DPFPRINTF((" src->tsval: %u tsecr: %u\n", src->scrub->pfss_tsval, src->scrub->pfss_tsecr));