diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2013-07-02 05:57:38 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2013-07-02 05:57:38 +0000 |
commit | 2b96ca6cdce17dc044c4dd8880f52a2f0f59844e (patch) | |
tree | 50420906efe8caaec9adcdffd275952ad6f652db /sys/net | |
parent | 75d37bab07e415128728589d49c5ba7c23daf2f0 (diff) |
Revert previous: sizeof(time_t) != sizeof(long) on LP64, so there was
an ABI change involved.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf_table.c | 43 | ||||
-rw-r--r-- | sys/net/pfvar.h | 12 |
2 files changed, 27 insertions, 28 deletions
diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index c2f4b983de7..19f5b5787cc 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.98 2013/07/02 01:42:01 guenther Exp $ */ +/* $OpenBSD: pf_table.c,v 1.99 2013/07/02 05:57:37 guenther Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -153,10 +153,10 @@ struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, u_int32_t); void pfr_destroy_kentries(struct pfr_kentryworkq *); void pfr_destroy_kentry(struct pfr_kentry *); void pfr_insert_kentries(struct pfr_ktable *, - struct pfr_kentryworkq *, time_t); + struct pfr_kentryworkq *, long); void pfr_remove_kentries(struct pfr_ktable *, struct pfr_kentryworkq *); -void pfr_clstats_kentries(struct pfr_kentryworkq *, time_t, +void pfr_clstats_kentries(struct pfr_kentryworkq *, long, int); void pfr_reset_feedback(struct pfr_addr *, int, int); void pfr_prepare_network(union sockaddr_union *, int, int); @@ -167,16 +167,15 @@ int pfr_unroute_kentry(struct pfr_ktable *, int pfr_walktree(struct radix_node *, void *, u_int); int pfr_validate_table(struct pfr_table *, int, int); int pfr_fix_anchor(char *); -void pfr_commit_ktable(struct pfr_ktable *, time_t); +void pfr_commit_ktable(struct pfr_ktable *, long); void pfr_insert_ktables(struct pfr_ktableworkq *); void pfr_insert_ktable(struct pfr_ktable *); void pfr_setflags_ktables(struct pfr_ktableworkq *); void pfr_setflags_ktable(struct pfr_ktable *, int); -void pfr_clstats_ktables(struct pfr_ktableworkq *, time_t, - int); -void pfr_clstats_ktable(struct pfr_ktable *, time_t, int); -struct pfr_ktable *pfr_create_ktable(struct pfr_table *, time_t, int, +void pfr_clstats_ktables(struct pfr_ktableworkq *, long, int); +void pfr_clstats_ktable(struct pfr_ktable *, long, int); +struct pfr_ktable *pfr_create_ktable(struct pfr_table *, long, int, int); void pfr_destroy_ktables(struct pfr_ktableworkq *, int); void pfr_destroy_ktable(struct pfr_ktable *, int); int pfr_ktable_compare(struct pfr_ktable *, @@ -272,7 +271,7 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size, struct pfr_kentry *p, *q; struct pfr_addr ad; int i, rv, xadd = 0; - time_t tzero = time_second; + long tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_FEEDBACK); if (pfr_validate_table(tbl, 0, flags & PFR_FLAG_USERIOCTL)) @@ -439,7 +438,7 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr *addr, int size, struct pfr_kentry *p, *q; struct pfr_addr ad; int i, rv, xadd = 0, xdel = 0, xchange = 0; - time_t tzero = time_second; + long tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_FEEDBACK); if (pfr_validate_table(tbl, ignore_pfrt_flags, flags & @@ -631,7 +630,7 @@ pfr_get_astats(struct pfr_table *tbl, struct pfr_astats *addr, int *size, struct pfr_walktree w; struct pfr_kentryworkq workq; int rv; - time_t tzero = time_second; + long tzero = time_second; if (pfr_validate_table(tbl, 0, 0)) return (EINVAL); @@ -886,7 +885,7 @@ pfr_destroy_kentry(struct pfr_kentry *ke) void pfr_insert_kentries(struct pfr_ktable *kt, - struct pfr_kentryworkq *workq, time_t tzero) + struct pfr_kentryworkq *workq, long tzero) { struct pfr_kentry *p; int rv, n = 0; @@ -910,7 +909,7 @@ pfr_insert_kentries(struct pfr_ktable *kt, } int -pfr_insert_kentry(struct pfr_ktable *kt, struct pfr_addr *ad, time_t tzero) +pfr_insert_kentry(struct pfr_ktable *kt, struct pfr_addr *ad, long tzero) { struct pfr_kentry *p; int rv; @@ -975,7 +974,7 @@ pfr_clean_node_mask(struct pfr_ktable *kt, } void -pfr_clstats_kentries(struct pfr_kentryworkq *workq, time_t tzero, int negchange) +pfr_clstats_kentries(struct pfr_kentryworkq *workq, long tzero, int negchange) { struct pfr_kentry *p; int s; @@ -1244,7 +1243,7 @@ pfr_add_tables(struct pfr_table *tbl, int size, int *nadd, int flags) struct pfr_ktableworkq addq, changeq; struct pfr_ktable *p, *q, *r, key; int i, rv, xadd = 0; - time_t tzero = time_second; + long tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY); SLIST_INIT(&addq); @@ -1395,7 +1394,7 @@ pfr_get_tstats(struct pfr_table *filter, struct pfr_tstats *tbl, int *size, struct pfr_ktable *p; struct pfr_ktableworkq workq; int s, n, nn; - time_t tzero = time_second; + long tzero = time_second; /* XXX PFR_FLAG_CLSTATS disabled */ ACCEPT_FLAGS(flags, PFR_FLAG_ALLRSETS); @@ -1440,7 +1439,7 @@ pfr_clr_tstats(struct pfr_table *tbl, int size, int *nzero, int flags) struct pfr_ktableworkq workq; struct pfr_ktable *p, key; int i, xzero = 0; - time_t tzero = time_second; + long tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY | PFR_FLAG_ADDRSTOO); SLIST_INIT(&workq); @@ -1693,7 +1692,7 @@ pfr_ina_commit(struct pfr_table *trs, u_int32_t ticket, int *nadd, struct pfr_ktableworkq workq; struct pf_ruleset *rs; int xadd = 0, xchange = 0; - time_t tzero = time_second; + long tzero = time_second; ACCEPT_FLAGS(flags, PFR_FLAG_DUMMY); rs = pf_find_ruleset(trs->pfrt_anchor); @@ -1729,7 +1728,7 @@ pfr_ina_commit(struct pfr_table *trs, u_int32_t ticket, int *nadd, } void -pfr_commit_ktable(struct pfr_ktable *kt, time_t tzero) +pfr_commit_ktable(struct pfr_ktable *kt, long tzero) { struct pfr_ktable *shadow = kt->pfrkt_shadow; int nflags; @@ -1926,7 +1925,7 @@ pfr_setflags_ktable(struct pfr_ktable *kt, int newf) } void -pfr_clstats_ktables(struct pfr_ktableworkq *workq, time_t tzero, int recurse) +pfr_clstats_ktables(struct pfr_ktableworkq *workq, long tzero, int recurse) { struct pfr_ktable *p; @@ -1935,7 +1934,7 @@ pfr_clstats_ktables(struct pfr_ktableworkq *workq, time_t tzero, int recurse) } void -pfr_clstats_ktable(struct pfr_ktable *kt, time_t tzero, int recurse) +pfr_clstats_ktable(struct pfr_ktable *kt, long tzero, int recurse) { struct pfr_kentryworkq addrq; int s; @@ -1953,7 +1952,7 @@ pfr_clstats_ktable(struct pfr_ktable *kt, time_t tzero, int recurse) } struct pfr_ktable * -pfr_create_ktable(struct pfr_table *tbl, time_t tzero, int attachruleset, +pfr_create_ktable(struct pfr_table *tbl, long tzero, int attachruleset, int intr) { struct pfr_ktable *kt; diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 639df4b6803..a4c7701fd84 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.385 2013/07/02 01:42:01 guenther Exp $ */ +/* $OpenBSD: pfvar.h,v 1.386 2013/07/02 05:57:37 guenther Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1060,7 +1060,7 @@ struct pfr_astats { struct pfr_addr pfras_a; u_int64_t pfras_packets[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; u_int64_t pfras_bytes[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; - time_t pfras_tzero; + long pfras_tzero; }; enum { PFR_REFCNT_RULE, PFR_REFCNT_ANCHOR, PFR_REFCNT_MAX }; @@ -1071,7 +1071,7 @@ struct pfr_tstats { u_int64_t pfrts_bytes[PFR_DIR_MAX][PFR_OP_TABLE_MAX]; u_int64_t pfrts_match; u_int64_t pfrts_nomatch; - time_t pfrts_tzero; + long pfrts_tzero; int pfrts_cnt; int pfrts_refcnt[PFR_REFCNT_MAX]; }; @@ -1090,7 +1090,7 @@ struct _pfr_kentry { union sockaddr_union _pfrke_sa; SLIST_ENTRY(pfr_kentry) _pfrke_workq; struct pfr_kcounters *_pfrke_counters; - time_t _pfrke_tzero; + long _pfrke_tzero; u_int8_t _pfrke_af; u_int8_t _pfrke_net; u_int8_t _pfrke_flags; @@ -1197,7 +1197,7 @@ struct pfi_kif { RB_ENTRY(pfi_kif) pfik_tree; u_int64_t pfik_packets[2][2][2]; u_int64_t pfik_bytes[2][2][2]; - time_t pfik_tzero; + u_int32_t pfik_tzero; int pfik_flags; int pfik_flags_new; void *pfik_ah_cookie; @@ -1869,7 +1869,7 @@ int pfr_get_tstats(struct pfr_table *, struct pfr_tstats *, int *, int); int pfr_clr_tstats(struct pfr_table *, int, int *, int); int pfr_set_tflags(struct pfr_table *, int, int, int, int *, int *, int); int pfr_clr_addrs(struct pfr_table *, int *, int); -int pfr_insert_kentry(struct pfr_ktable *, struct pfr_addr *, time_t); +int pfr_insert_kentry(struct pfr_ktable *, struct pfr_addr *, long); int pfr_add_addrs(struct pfr_table *, struct pfr_addr *, int, int *, int); int pfr_del_addrs(struct pfr_table *, struct pfr_addr *, int, int *, |