summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2012-09-19 13:47:17 +0000
committermikeb <mikeb@openbsd.org>2012-09-19 13:47:17 +0000
commitd120651bd995459fe1d18c9ce039a086931f39e1 (patch)
tree6ba287744500f69a0b63650cb29aaf0c78f96c11
parentexpandnodes must be bzero()'d before parsing to be sure there is no bogus (diff)
downloadwireguard-openbsd-d120651bd995459fe1d18c9ce039a086931f39e1.tar.xz
wireguard-openbsd-d120651bd995459fe1d18c9ce039a086931f39e1.zip
update the tdb replay counter endian conversion to 64 bits;
ok camield mpf
-rw-r--r--sys/net/if_pfsync.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 44b998d6751..6e9b3e82e41 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.189 2012/07/26 12:25:31 mikeb Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.190 2012/09/19 13:47:17 mikeb Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -1210,7 +1210,7 @@ pfsync_update_net_tdb(struct pfsync_tdb *pt)
s = spltdb();
tdb = gettdb(ntohs(pt->rdomain), pt->spi, &pt->dst, pt->sproto);
if (tdb) {
- pt->rpl = ntohl(pt->rpl);
+ pt->rpl = betoh64(pt->rpl);
pt->cur_bytes = betoh64(pt->cur_bytes);
/* Neither replay nor byte counter should ever decrease. */
@@ -2199,7 +2199,7 @@ pfsync_out_tdb(struct tdb *t, void *buf)
* this edge case.
*/
#define RPL_INCR 16384
- ut->rpl = htonl(t->tdb_rpl + (ISSET(t->tdb_flags, TDBF_PFSYNC_RPL) ?
+ ut->rpl = htobe64(t->tdb_rpl + (ISSET(t->tdb_flags, TDBF_PFSYNC_RPL) ?
RPL_INCR : 0));
ut->cur_bytes = htobe64(t->tdb_cur_bytes);
ut->sproto = t->tdb_sproto;