Browse code

Eliminate check_fragment function

This another of the small wrapper function where the check is
better move into the calling function.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200810143707.5834-10-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20672.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Arne Schwabe authored on 2020/08/10 23:36:59
Showing 2 changed files
... ...
@@ -129,8 +129,6 @@ static inline void
129 129
 check_incoming_control_channel(struct context *c)
130 130
 {
131 131
 #if P2MP
132
-    void check_incoming_control_channel_dowork(struct context *c);
133
-
134 132
     if (tls_test_payload_len(c->c2.tls_multi) > 0)
135 133
     {
136 134
         check_incoming_control_channel_dowork(c);
... ...
@@ -138,22 +136,6 @@ check_incoming_control_channel(struct context *c)
138 138
 #endif
139 139
 }
140 140
 
141
-#ifdef ENABLE_FRAGMENT
142
-/*
143
- * Should we deliver a datagram fragment to remote?
144
- */
145
-static inline void
146
-check_fragment(struct context *c)
147
-{
148
-    void check_fragment_dowork(struct context *c);
149
-
150
-    if (c->c2.fragment)
151
-    {
152
-        check_fragment_dowork(c);
153
-    }
154
-}
155
-#endif
156
-
157 141
 /*
158 142
  * Set our wakeup to 0 seconds, so we will be rescheduled
159 143
  * immediately.
... ...
@@ -520,7 +502,7 @@ check_status_file(struct context *c)
520 520
  * Should we deliver a datagram fragment to remote?
521 521
  */
522 522
 void
523
-check_fragment_dowork(struct context *c)
523
+check_fragment(struct context *c)
524 524
 {
525 525
     struct link_socket_info *lsi = get_link_socket_info(c);
526 526
 
... ...
@@ -1903,7 +1885,10 @@ pre_select(struct context *c)
1903 1903
 
1904 1904
 #ifdef ENABLE_FRAGMENT
1905 1905
     /* Should we deliver a datagram fragment to remote? */
1906
-    check_fragment(c);
1906
+    if (c->c2.fragment)
1907
+    {
1908
+        check_fragment(c);
1909
+    }
1907 1910
 #endif
1908 1911
 
1909 1912
     /* Update random component of timeout */
... ...
@@ -84,7 +84,7 @@ void check_push_request(struct context *c);
84 84
 #endif /* P2MP */
85 85
 
86 86
 #ifdef ENABLE_FRAGMENT
87
-void check_fragment_dowork(struct context *c);
87
+void check_fragment(struct context *c);
88 88
 
89 89
 #endif /* ENABLE_FRAGMENT */
90 90