summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2016-06-15 11:36:07 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2016-06-15 11:36:07 +0000
commit886dfd50aa859e63e73ed4c7f89ec6dbebf3388a (patch)
treee570d204e11a3ca3df3d7ee56dcf6b745bc76332 /sys/net/pf.c
parent8b9a72eb233816bfd30e5f768517ffa130ea248e (diff)
There's no need to convert values returned by arc4random to the network
byte order. Spotted by Gleb Smirnoff (glebius@FreeBSD.org), thanks! ok tedu
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index a659fa7d63a..960ac320b94 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.975 2016/06/07 01:31:54 tedu Exp $ */
+/* $OpenBSD: pf.c,v 1.976 2016/06/15 11:36:06 mikeb Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -3650,7 +3650,7 @@ pf_create_state(struct pf_pdesc *pd, struct pf_rule *r, struct pf_rule *a,
if (act->rtableid >= 0)
rtid = act->rtableid;
s->src.state = PF_TCPS_PROXY_SRC;
- s->src.seqhi = htonl(arc4random());
+ s->src.seqhi = arc4random();
/* Find mss option */
mss = pf_get_mss(pd);
mss = pf_calc_mss(pd->src, pd->af, rtid, mss);
@@ -4271,7 +4271,7 @@ pf_synproxy(struct pf_pdesc *pd, struct pf_state **state, u_short *reason)
}
(*state)->src.max_win = MAX(ntohs(th->th_win), 1);
if ((*state)->dst.seqhi == 1)
- (*state)->dst.seqhi = htonl(arc4random());
+ (*state)->dst.seqhi = arc4random();
pf_send_tcp((*state)->rule.ptr, pd->af,
&sk->addr[pd->sidx], &sk->addr[pd->didx],
sk->port[pd->sidx], sk->port[pd->didx],