From 87c2fd4310e5b345102d7a4915dc5e3a65052305 Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Sun, 14 Oct 2018 22:51:08 +0200 Subject: Revert "Merge branch 'stretch' of ssh://git.debian.org/git/collab-maint/openvpn into stretch" This reverts commit 3804bc2606a92e2f2f4b3a2b043af0d77d92b386, reversing changes made to 678cfd249add7ca758e4c41933c7b730132c99f4. --- src/openvpn/packet_id.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) (limited to 'src/openvpn/packet_id.c') diff --git a/src/openvpn/packet_id.c b/src/openvpn/packet_id.c index 6f70c5d..fe13e1d 100644 --- a/src/openvpn/packet_id.c +++ b/src/openvpn/packet_id.c @@ -325,40 +325,12 @@ packet_id_read(struct packet_id_net *pin, struct buffer *buf, bool long_form) return true; } -static bool -packet_id_send_update(struct packet_id_send *p, bool long_form) -{ - if (!p->time) - { - p->time = now; - } - if (p->id == PACKET_ID_MAX) - { - /* Packet ID only allowed to roll over if using long form and time has - * moved forward since last roll over. - */ - if (!long_form || now <= p->time) - { - return false; - } - p->time = now; - p->id = 0; - } - p->id++; - return true; -} - bool -packet_id_write(struct packet_id_send *p, struct buffer *buf, bool long_form, - bool prepend) +packet_id_write(const struct packet_id_net *pin, struct buffer *buf, bool long_form, bool prepend) { - if (!packet_id_send_update(p, long_form)) - { - return false; - } + packet_id_type net_id = htonpid(pin->id); + net_time_t net_time = htontime(pin->time); - const packet_id_type net_id = htonpid(p->id); - const net_time_t net_time = htontime(p->time); if (prepend) { if (long_form) -- cgit v1.2.3