summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2011-06-14 10:14:02 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2011-06-14 10:14:02 +0000
commit5b362307baec698139f49c49033ccfa6dc69b682 (patch)
treea4b76e2579b0dc76041a95adb9b2672fe6df43ba /sys/net/pf.c
parentb4e6f3fb65b075e2f4b010f167f075bb345b8584 (diff)
KNF (no change in .o files)
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 98b54e8f05f..76f16f2b591 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.747 2011/06/02 22:08:40 sthen Exp $ */
+/* $OpenBSD: pf.c,v 1.748 2011/06/14 10:14:01 mcbride Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -202,9 +202,9 @@ int pf_test_state_udp(struct pf_state **, int,
struct pfi_kif *, struct mbuf *, int,
struct pf_pdesc *);
int pf_icmp_state_lookup(struct pf_state_key_cmp *,
- struct pf_pdesc *, struct pf_state **, struct mbuf *,
- int, struct pfi_kif *, u_int16_t, u_int16_t,
- int, int *, int, int);
+ struct pf_pdesc *, struct pf_state **,
+ struct mbuf *, int, struct pfi_kif *, u_int16_t,
+ u_int16_t, int, int *, int, int);
int pf_test_state_icmp(struct pf_state **, int,
struct pfi_kif *, struct mbuf *, int,
struct pf_pdesc *, u_short *);
@@ -2987,7 +2987,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, int direction,
if (r->action == PF_PASS && af == AF_INET && ! r->allow_opts) {
struct ip *h4 = mtod(m, struct ip *);
-
+
if (h4->ip_hl > 5) {
REASON_SET(&reason, PFRES_IPOPTIONS);
pd->pflog |= PF_LOG_FORCE;
@@ -3270,7 +3270,7 @@ pf_translate(struct pf_pdesc *pd, struct pf_addr *saddr, u_int16_t sport,
case IPPROTO_TCP:
if (PF_ANEQ(saddr, pd->src, pd->af) || *pd->sport != sport) {
pf_change_ap(pd->src, pd->sport, &pd->hdr.tcp->th_sum,
- saddr, sport, 0, pd->af);
+ saddr, sport, 0, pd->af);
rewrite = 1;
}
if (PF_ANEQ(daddr, pd->dst, pd->af) || *pd->dport != dport) {
@@ -4015,7 +4015,7 @@ pf_test_state_tcp(struct pf_state **state, int direction, struct pfi_kif *kif,
pd->destchg = 1;
if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af) ||
nk->port[pd->didx] != th->th_dport)
- pf_change_ap(pd->dst, &th->th_dport, &th->th_sum,
+ pf_change_ap(pd->dst, &th->th_dport, &th->th_sum,
&nk->addr[pd->didx], nk->port[pd->didx], 0, pd->af);
m->m_pkthdr.rdomain = nk->rdomain;
copyback = 1;
@@ -4626,7 +4626,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kif *kif,
if (PF_ANEQ(pd2.dst,
&nk->addr[pd2.didx], pd2.af))
- pf_change_icmp(pd2.dst, NULL, saddr,
+ pf_change_icmp(pd2.dst, NULL, saddr,
&nk->addr[pd2.didx], 0, NULL,
pd2.ip_sum, icmpsum, 0, AF_INET);
@@ -4679,7 +4679,7 @@ pf_test_state_icmp(struct pf_state **state, int direction, struct pfi_kif *kif,
if (PF_ANEQ(pd2.src,
&nk->addr[pd2.sidx], pd2.af) ||
- ((virtual_type ==
+ ((virtual_type ==
htons(ICMP6_ECHO_REQUEST)) &&
nk->port[pd2.sidx] != iih.icmp6_id))
pf_change_icmp(pd2.src,
@@ -5115,7 +5115,8 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
m0->m_pkthdr.pf.flags |= PF_TAG_GENERATED;
} else {
if (s == NULL) {
- if (pf_map_addr(AF_INET, r, (struct pf_addr *)&ip->ip_src,
+ if (pf_map_addr(AF_INET, r,
+ (struct pf_addr *)&ip->ip_src,
&naddr, NULL, &sn, &r->route, PF_SN_ROUTE)) {
DPFPRINTF(LOG_ERR,
"pf_route: pf_map_addr() failed.");
@@ -5700,7 +5701,7 @@ void
pf_counters_inc(int dir, int action, struct pf_pdesc *pd,
struct pfi_kif *kif, struct pf_state *s,
struct pf_rule *r, struct pf_rule *a)
-{
+{
int dirndx;
kif->pfik_bytes[pd->af == AF_INET6][dir == PF_OUT][action != PF_PASS]
+= pd->tot_len;