]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Remove extra_link from frame
authorArne Schwabe <arne@rfc2549.org>
Thu, 10 Feb 2022 16:26:30 +0000 (17:26 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 13 Feb 2022 10:43:49 +0000 (11:43 +0100)
The previous commits removed any reads from this variable. So we can
now safely remove it.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220210162632.3309974-6-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23751.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c
src/openvpn/mtu.c
src/openvpn/mtu.h
src/openvpn/socks.c
src/openvpn/socks.h
src/openvpn/ssl.c

index 7c5e4ce13d67ec30b754021fe5b3c2c9cedd926d..98c919c0c2b139f151a09d03354e4f2db94ef45c 100644 (file)
@@ -3110,14 +3110,6 @@ do_init_frame(struct context *c)
     }
 #endif /* USE_COMP */
 
-    /*
-     * Adjust frame size for UDP Socks support.
-     */
-    if (c->options.ce.socks_proxy_server)
-    {
-        socks_adjust_frame_parameters(&c->c2.frame, c->options.ce.proto);
-    }
-
     /*
      * Adjust frame size based on the --tun-mtu-extra parameter.
      */
@@ -3150,17 +3142,6 @@ do_init_frame(struct context *c)
 #endif
 #endif /* USE_COMP */
 
-    /* packets with peer-id (P_DATA_V2) need 3 extra bytes in frame (on client)
-     * and need link_mtu+3 bytes on socket reception (on server).
-     *
-     * accommodate receive path in f->extra_link, which has the side effect of
-     * also increasing send buffers (BUF_SIZE() macro), which need to be
-     * allocated big enough before receiving peer-id option from server.
-     *
-     * f->extra_frame is adjusted when peer-id option is push-received
-     */
-    frame_add_to_extra_link(&c->c2.frame, 3);
-
 #ifdef ENABLE_FRAGMENT
     /*
      * Set frame parameter for fragment code.  This is necessary because
index 6d349f7a14c3d9501ec37be7897e25c8c78cabcf..2c455c3ef9c46bea6de09901b2a3ea07d6a60ae7 100644 (file)
@@ -266,7 +266,6 @@ frame_print(const struct frame *frame,
     buf_printf(&out, " EF:%d", frame->extra_frame);
     buf_printf(&out, " EB:%d", frame->extra_buffer);
     buf_printf(&out, " ET:%d", frame->extra_tun);
-    buf_printf(&out, " EL:%d", frame->extra_link);
     buf_printf(&out, " ]");
 
     msg(level, "%s", out.data);
index 5f7205f43c4c3080c8e8684df81a1e71367e77b0..6188c0da5d1ad589f2bce6feab49216d31b3a091 100644 (file)
@@ -163,13 +163,6 @@ struct frame {
                                  *   which defaults to 0 for tun and 32
                                  *   (\c TAP_MTU_EXTRA_DEFAULT) for tap.
                                  *   */
-
-    int extra_link;             /**< Maximum number of bytes in excess of
-                                 *   external network interface's MTU that
-                                 *   might be read from or written to it.
-                                 *
-                                 *   Used by peer-id (3) and
-                                 *   socks UDP (10) */
 };
 
 /* Forward declarations, to prevent includes */
@@ -378,12 +371,6 @@ frame_add_to_extra_tun(struct frame *frame, const int increment)
     frame->extra_tun += increment;
 }
 
-static inline void
-frame_add_to_extra_link(struct frame *frame, const int increment)
-{
-    frame->extra_link += increment;
-}
-
 static inline void
 frame_add_to_extra_buffer(struct frame *frame, const int increment)
 {
index f5108b034c4269b3c86e0ff14edae5912ddf345e..768bb613709f6875b3d9e416e485fc51a504e317 100644 (file)
 
 #define UP_TYPE_SOCKS           "SOCKS Proxy"
 
-void
-socks_adjust_frame_parameters(struct frame *frame, int proto)
-{
-    if (proto == PROTO_UDP)
-    {
-        frame_add_to_extra_link(frame, 10);
-    }
-}
-
 struct socks_proxy_info *
 socks_proxy_new(const char *server,
                 const char *port,
@@ -610,7 +601,7 @@ socks_process_outgoing_udp(struct buffer *buf,
     /*
      * Get a 10 byte subset buffer prepended to buf --
      * we expect these bytes will be here because
-     * we allocated frame space in socks_adjust_frame_parameters.
+     * we always allocate space for these bytes
      */
     struct buffer head = buf_sub(buf, 10, true);
 
index 88cf9523cc9eae01cc99d335618f5a4ef529d4e3..47cdac108b6589cdace082f8345c1337be576e4c 100644 (file)
@@ -42,8 +42,6 @@ struct socks_proxy_info {
     char authfile[256];
 };
 
-void socks_adjust_frame_parameters(struct frame *frame, int proto);
-
 struct socks_proxy_info *socks_proxy_new(const char *server,
                                          const char *port,
                                          const char *authfile);
index 10f75d66ee3b5a2956c6c38a9106111691230a30..38085f7710e8cc489e78ee4c21bc987865bfe37b 100644 (file)
@@ -322,7 +322,6 @@ tls_init_control_channel_frame_parameters(const struct frame *data_channel_frame
 
     /* inherit link MTU and extra_link from data channel */
     frame->link_mtu = data_channel_frame->link_mtu;
-    frame->extra_link = data_channel_frame->extra_link;
 
     /* set extra_frame */
     tls_adjust_frame_parameters(frame);