diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2011-09-22 14:57:13 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2011-09-22 14:57:13 +0000 |
commit | 94041046f9865dbaf571c80ab6d4164b94697f1a (patch) | |
tree | 3aa8f77f8ed6e36d5d9a59ee9211ad9134872202 /sys/net | |
parent | 9ab7bf3acd6ab99b33e2beb51bde5833631b3455 (diff) |
As I have touched half of pf lines anyway, fix whitespaces now.
KNF, no binary change.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 40 | ||||
-rw-r--r-- | sys/net/pf_norm.c | 28 | ||||
-rw-r--r-- | sys/net/pf_osfp.c | 7 | ||||
-rw-r--r-- | sys/net/pfvar.h | 18 |
4 files changed, 47 insertions, 46 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index ea5895e8357..9f5cc078a5c 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.780 2011/09/21 19:07:30 bluhm Exp $ */ +/* $OpenBSD: pf.c,v 1.781 2011/09/22 14:57:12 bluhm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1860,7 +1860,6 @@ pf_change_icmp(struct pf_addr *ia, u_int16_t *ip, struct pf_addr *oa, } } - /* * Need to modulate the sequence numbers in the TCP SACK option * (credits to Krzysztof Pfaff for report and patch) @@ -1868,11 +1867,12 @@ pf_change_icmp(struct pf_addr *ia, u_int16_t *ip, struct pf_addr *oa, int pf_modulate_sack(struct mbuf *m, struct pf_pdesc *pd, struct pf_state_peer *dst) { - struct tcphdr *th = pd->hdr.tcp; - int hlen = (th->th_off << 2) - sizeof(*th), thoptlen = hlen; - u_int8_t opts[MAX_TCPOPTLEN], *opt = opts; - int copyback = 0, i, olen; - struct sackblk sack; + struct tcphdr *th = pd->hdr.tcp; + int hlen = (th->th_off << 2) - sizeof(*th); + int thoptlen = hlen; + u_int8_t opts[MAX_TCPOPTLEN], *opt = opts; + int copyback = 0, i, olen; + struct sackblk sack; #define TCPOLEN_SACKLEN (TCPOLEN_SACK + 2) if (hlen < TCPOLEN_SACKLEN || !pf_pull_hdr(m, pd->off + sizeof(*th), @@ -2718,7 +2718,7 @@ pf_rule_to_actions(struct pf_rule *r, struct pf_rule_actions *a) a->prio[1] = r->prio[1]; } -#define PF_TEST_ATTRIB(t, a) \ +#define PF_TEST_ATTRIB(t, a) \ do { \ if (t) { \ r = a; \ @@ -2840,11 +2840,12 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, struct mbuf *m, break; case IPPROTO_TCP: - PF_TEST_ATTRIB(((r->flagset & th->th_flags) != r->flags), + PF_TEST_ATTRIB(((r->flagset & th->th_flags) != + r->flags), TAILQ_NEXT(r, entries)); PF_TEST_ATTRIB((r->os_fingerprint != PF_OSFP_ANY && !pf_osfp_match(pf_osfp_fingerprint(pd, m), - r->os_fingerprint)), + r->os_fingerprint)), TAILQ_NEXT(r, entries)); /* FALLTHROUGH */ @@ -2886,7 +2887,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, struct mbuf *m, default: break; - } + } PF_TEST_ATTRIB((r->rule_flag & PFRULE_FRAGMENT && pd->virtual_proto != PF_VPROTO_FRAGMENT), @@ -4202,18 +4203,17 @@ pf_test_state_icmp(struct pf_state **state, struct mbuf *m, * ICMP error message in response to a TCP/UDP packet. * Extract the inner TCP/UDP header and search for that state. */ - - struct pf_pdesc pd2; + struct pf_pdesc pd2; #ifdef INET - struct ip h2; + struct ip h2; #endif /* INET */ #ifdef INET6 - struct ip6_hdr h2_6; - int fragoff2, extoff2; - u_int32_t jumbolen; + struct ip6_hdr h2_6; + int fragoff2, extoff2; + u_int32_t jumbolen; #endif /* INET6 */ u_int16_t *ipsum2; - int ipoff2; + int ipoff2; /* Initialize pd2 fields valid for both packets with pd. */ bzero(&pd2, sizeof(pd2)); @@ -4330,8 +4330,8 @@ pf_test_state_icmp(struct pf_state **state, struct mbuf *m, } if (!((*state)->state_flags & PFSTATE_SLOPPY) && - (!SEQ_GEQ(src->seqhi, seq) || - !SEQ_GEQ(seq, src->seqlo - (dst->max_win << dws)))) { + (!SEQ_GEQ(src->seqhi, seq) || !SEQ_GEQ(seq, + src->seqlo - (dst->max_win << dws)))) { if (pf_status.debug >= LOG_NOTICE) { log(LOG_NOTICE, "pf: BAD ICMP %d:%d ", diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c index 6134c88c81c..c89c37367a7 100644 --- a/sys/net/pf_norm.c +++ b/sys/net/pf_norm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_norm.c,v 1.144 2011/09/21 19:07:30 bluhm Exp $ */ +/* $OpenBSD: pf_norm.c,v 1.145 2011/09/22 14:57:12 bluhm Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> @@ -870,10 +870,10 @@ int pf_normalize_tcp_init(struct mbuf *m, struct pf_pdesc *pd, struct pf_state_peer *src, struct pf_state_peer *dst) { - struct tcphdr *th = pd->hdr.tcp; - u_int32_t tsval, tsecr; - u_int8_t hdr[60]; - u_int8_t *opt; + struct tcphdr *th = pd->hdr.tcp; + u_int32_t tsval, tsecr; + u_int8_t hdr[60]; + u_int8_t *opt; KASSERT(src->scrub == NULL); @@ -966,14 +966,14 @@ pf_normalize_tcp_stateful(struct mbuf *m, struct pf_pdesc *pd, u_short *reason, struct pf_state *state, struct pf_state_peer *src, struct pf_state_peer *dst, int *writeback) { - struct tcphdr *th = pd->hdr.tcp; - struct timeval uptime; - u_int32_t tsval, tsecr; - u_int tsval_from_last; - u_int8_t hdr[60]; - u_int8_t *opt; - int copyback = 0; - int got_ts = 0; + struct tcphdr *th = pd->hdr.tcp; + struct timeval uptime; + u_int32_t tsval, tsecr; + u_int tsval_from_last; + u_int8_t hdr[60]; + u_int8_t *opt; + int copyback = 0; + int got_ts = 0; KASSERT(src->scrub || dst->scrub); @@ -1128,7 +1128,7 @@ pf_normalize_tcp_stateful(struct mbuf *m, struct pf_pdesc *pd, * measurement of RTT (round trip time) and PAWS * (protection against wrapped sequence numbers). PAWS * gives us a set of rules for rejecting packets on - * long fat pipes (packets that were somehow delayed + * long fat pipes (packets that were somehow delayed * in transit longer than the time it took to send the * full TCP sequence space of 4Gb). We can use these * rules and infer a few others that will let us treat diff --git a/sys/net/pf_osfp.c b/sys/net/pf_osfp.c index 514b6c2a1c3..8207b0d9060 100644 --- a/sys/net/pf_osfp.c +++ b/sys/net/pf_osfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_osfp.c,v 1.24 2011/09/21 19:07:30 bluhm Exp $ */ +/* $OpenBSD: pf_osfp.c,v 1.25 2011/09/22 14:57:12 bluhm Exp $ */ /* * Copyright (c) 2003 Mike Frantzen <frantzen@w4g.org> @@ -108,7 +108,8 @@ pf_osfp_fingerprint(struct pf_pdesc *pd, struct mbuf *m) #endif /* _KERNEL */ struct pf_osfp_enlist * -pf_osfp_fingerprint_hdr(const struct ip *ip, const struct ip6_hdr *ip6, const struct tcphdr *tcp) +pf_osfp_fingerprint_hdr(const struct ip *ip, const struct ip6_hdr *ip6, + const struct tcphdr *tcp) { struct pf_os_fingerprint fp, *fpresult; int cnt, optlen = 0; @@ -275,7 +276,7 @@ pf_osfp_match(struct pf_osfp_enlist *list, pf_osfp_t os) if ((os_class == PF_OSFP_ANY || en_class == os_class) && (os_version == PF_OSFP_ANY || en_version == os_version) && (os_subtype == PF_OSFP_ANY || en_subtype == os_subtype)) { - DPFPRINTF(LOG_NOTICE, + DPFPRINTF(LOG_NOTICE, "osfp matched %s %s %s %x==%x", entry->fp_class_nm, entry->fp_version_nm, entry->fp_subtype_nm, os, entry->fp_os); diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 54ddabd9984..4aa5b48ebdf 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.349 2011/09/20 10:51:18 bluhm Exp $ */ +/* $OpenBSD: pfvar.h,v 1.350 2011/09/22 14:57:12 bluhm Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -196,7 +196,7 @@ struct pfi_dynaddr { #ifndef PF_DEBUGNAME #define PF_DEBUGNAME "pf: " #endif - + #ifdef _KERNEL #define DPFPRINTF(n, format, x...) \ do { \ @@ -410,12 +410,12 @@ struct pf_poolhashkey { struct pf_pool { struct pf_addr_wrap addr; struct pf_poolhashkey key; - struct pf_addr counter; + struct pf_addr counter; char ifname[IFNAMSIZ]; struct pfi_kif *kif; int tblidx; u_int64_t states; - int curweight; + int curweight; u_int16_t weight; u_int16_t proxy_port[2]; u_int8_t port_op; @@ -821,7 +821,7 @@ struct pf_state { u_int64_t packets[2]; u_int64_t bytes[2]; u_int32_t creation; - u_int32_t expire; + u_int32_t expire; u_int32_t pfsync_time; u_int16_t qid; u_int16_t pqid; @@ -928,7 +928,7 @@ struct pfsync_state { (d)->state = (s)->state; \ (d)->wscale = (s)->wscale; \ if ((s)->scrub) { \ - (d)->scrub.pfss_flags = \ + (d)->scrub.pfss_flags = \ htons((s)->scrub->pfss_flags & PFSS_TIMESTAMP); \ (d)->scrub.pfss_ttl = (s)->scrub->pfss_ttl; \ (d)->scrub.pfss_ts_mod = htonl((s)->scrub->pfss_ts_mod);\ @@ -944,7 +944,7 @@ struct pfsync_state { (d)->mss = ntohs((s)->mss); \ (d)->state = (s)->state; \ (d)->wscale = (s)->wscale; \ - if ((s)->scrub.scrub_flag == PFSYNC_SCRUB_FLAG_VALID && \ + if ((s)->scrub.scrub_flag == PFSYNC_SCRUB_FLAG_VALID && \ (d)->scrub != NULL) { \ (d)->scrub->pfss_flags = \ ntohs((s)->scrub.pfss_flags) & PFSS_TIMESTAMP; \ @@ -1099,7 +1099,7 @@ enum { PFRKE_PLAIN, PFRKE_ROUTE, PFRKE_COST, PFRKE_MAX }; struct pfr_kentry { union { - struct _pfr_kentry _ke; + struct _pfr_kentry _ke; } u; }; #define pfrke_node u._ke._pfrke_node @@ -1480,7 +1480,7 @@ struct pf_divert { #define PFR_KTABLE_HIWAT 1000 /* Number of tables */ #define PFR_KENTRY_HIWAT 200000 /* Number of table entries */ -#define PFR_KENTRY_HIWAT_SMALL 100000 /* Number of table entries (tiny hosts) */ +#define PFR_KENTRY_HIWAT_SMALL 100000 /* Number of entries for tiny hosts */ /* * ioctl parameter structures |