]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Get rid of unused 'bool tuntap_buffer' arguments.
authorGert Doering <gert@greenie.muc.de>
Wed, 1 Feb 2023 14:15:18 +0000 (14:15 +0000)
committerGert Doering <gert@greenie.muc.de>
Fri, 10 Feb 2023 18:59:56 +0000 (19:59 +0100)
overlapped_io_init() has a "bool tuntap_buffer" argument which is only
passed onwards to alloc_buf_sock_tun(), which does nothing with it.

Remove from both functions.

v2:
  move alloc_buf_sock_tun() to win32.c

v3:
  leave alloc_buf_sock_tun() where it is, and fix non-WIN32 call from
socket.c

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20230130161730.110021-1-gert@greenie.muc.de>
URL:
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26099.h
tml
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit bdc842d72e92995261bac3579120c94f93e4064a)
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20230201141518.119157-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26122.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/mtu.c
src/openvpn/mtu.h
src/openvpn/socket.c
src/openvpn/tun.c
src/openvpn/win32.c
src/openvpn/win32.h

index 1d9ebe011c058aecfa4a2788b0569bb58db73d96..748a1cf19c2466f15a1bf5085bd5d29aa8fc792d 100644 (file)
@@ -42,8 +42,7 @@
 /* allocate a buffer for socket or tun layer */
 void
 alloc_buf_sock_tun(struct buffer *buf,
-                   const struct frame *frame,
-                   const bool tuntap_buffer)
+                   const struct frame *frame)
 {
     /* allocate buffer for overlapped I/O */
     *buf = alloc_buf(BUF_SIZE(frame));
index 0ff4f7bfa2c124a3c80a7bf44728332707c81676..65236508f4b9c401e4f9fc9f7c5d0e48b7a852c4 100644 (file)
@@ -265,8 +265,7 @@ calc_packet_id_size_dc(const struct options *options,
  * allocate a buffer for socket or tun layer
  */
 void alloc_buf_sock_tun(struct buffer *buf,
-                        const struct frame *frame,
-                        const bool tuntap_buffer);
+                        const struct frame *frame);
 
 /*
  * EXTENDED_SOCKET_ERROR_CAPABILITY functions -- print extra error info
index a883ac4a156c06211a0c8c59ec077f3b1dad16d4..42d953390461ef4a1656f70d3d6e44d2a82066ab 100644 (file)
@@ -1623,8 +1623,8 @@ static void
 socket_frame_init(const struct frame *frame, struct link_socket *sock)
 {
 #ifdef _WIN32
-    overlapped_io_init(&sock->reads, frame, FALSE, false);
-    overlapped_io_init(&sock->writes, frame, TRUE, false);
+    overlapped_io_init(&sock->reads, frame, FALSE);
+    overlapped_io_init(&sock->writes, frame, TRUE);
     sock->rw_handle.read = sock->reads.overlapped.hEvent;
     sock->rw_handle.write = sock->writes.overlapped.hEvent;
 #endif
@@ -1637,9 +1637,7 @@ socket_frame_init(const struct frame *frame, struct link_socket *sock)
                         sock->sockflags,
                         sock->info.proto);
 #else
-        alloc_buf_sock_tun(&sock->stream_buf_data,
-                           frame,
-                           false);
+        alloc_buf_sock_tun(&sock->stream_buf_data, frame);
 
         stream_buf_init(&sock->stream_buf,
                         &sock->stream_buf_data,
index 01c85f9ff51798c6a9dc37b512d55f50d2398a95..20f80798a81b51d136be50575acdbe3579e3c471 100644 (file)
@@ -898,8 +898,8 @@ init_tun_post(struct tuntap *tt,
         return;
     }
 
-    overlapped_io_init(&tt->reads, frame, FALSE, true);
-    overlapped_io_init(&tt->writes, frame, TRUE, true);
+    overlapped_io_init(&tt->reads, frame, FALSE);
+    overlapped_io_init(&tt->writes, frame, TRUE);
     tt->adapter_index = TUN_ADAPTER_INDEX_INVALID;
 
     if (tt->windows_driver == WINDOWS_DRIVER_WINTUN)
index ad3d9bf6dba771f5e6f175b1ebb3123e45cecc99..4c3ea842c918f53fec401e3ce1878bc87e2c561a 100644 (file)
@@ -173,8 +173,7 @@ init_security_attributes_allow_all(struct security_attributes *obj)
 void
 overlapped_io_init(struct overlapped_io *o,
                    const struct frame *frame,
-                   BOOL event_state,
-                   bool tuntap_buffer)  /* if true: tuntap buffer, if false: socket buffer */
+                   BOOL event_state)
 {
     CLEAR(*o);
 
@@ -186,7 +185,7 @@ overlapped_io_init(struct overlapped_io *o,
     }
 
     /* allocate buffer for overlapped I/O */
-    alloc_buf_sock_tun(&o->buf_init, frame, tuntap_buffer);
+    alloc_buf_sock_tun(&o->buf_init, frame);
 }
 
 void
index a1a4550319fbc959a9f19e364f4292560a7cb4f7..72ffb012e3c1731f674bab051bdb64e562f263a3 100644 (file)
@@ -217,8 +217,7 @@ struct overlapped_io {
 
 void overlapped_io_init(struct overlapped_io *o,
                         const struct frame *frame,
-                        BOOL event_state,
-                        bool tuntap_buffer);
+                        BOOL event_state);
 
 void overlapped_io_close(struct overlapped_io *o);