Re: [Openvpn-devel] [PATCH applied] Add coverity static analysis to Travis CI config

2017-08-18 Thread David Sommerseth
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Your patch has been applied to the following branches

commit 4a05f15c9aafe314ae4d3642813ebf234c09276e  (master)
commit e12d5e35d56103357301d28e3f9ee0468e306bb1  (release/2.4)
Author: Steffan Karger
Date:   Tue Aug 8 17:55:41 2017 +0200

 Add coverity static analysis to Travis CI config

 Signed-off-by: Steffan Karger 
 Acked-by: Antonio Quartulli 
 Message-Id: <1502207741-31750-1-git-send-email-steffan.kar...@fox-it.com>
 URL: 
https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15176.html
 Signed-off-by: David Sommerseth 


- --
kind regards,

David Sommerseth

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCgAGBQJZlypjAAoJEIbPlEyWcf3yuQEP/jOPlCPbSsgCDLWUHkNgLhOM
CQ32K1dbYuOrPo7pmjewyebF0NdkB6dbUVAMBvy5vWtyPawAz+65KwtKVwORKcf/
INkJwerRG5W9gymd0OeFAydmvQ/OvgI40u8jrLAeGIFlqTsoqg4SmmyNgCnxL7zP
u5p3J1j5RcWUBGaOGcUYyJsHGGkMSxlp3CcrDpXevqp65Pb8CvAHuxtOZHxKOrw4
Xm8SfdXaSm2NU0gUeKibQdPqkSq9bU1W1LH22EbxFFJLJVOKtpMvVF3bzbG4xR2c
Zw8yFwqLxgwuT7a0/8dIGEgNLapkGKC5NFX+MlVAdG+EjX1cFaLoyeapvBANYqEB
8YjrJZjJPSEUmaejFcnIgMhWIIbsFGg+qzrXfRC601JuxYEEdANknIIlwIo5hXfq
NmRD3ViqnBiKCTuW2cs1iMQvsWfyijgKUHkzPZlzllAUlEjKit8KGxbqtmZg5VDI
UPOS+gvqQtqK0VRm1IJyKyHLQGIYYmV35rEEBZpA/Yf0sfohaRhzDOVIi1Lq/xQ4
mPyCU978f8plD1Q7QO+x5TGvFYsQaPoYwpd7uApDwDQN5wttMnBebnuHyej0a9Iv
w19Brl8N8pypYHM44gkGG40jZaevE+7/qxxNScp5MbbEsJlyCZYCjwyEwUvMZ3ym
WVjUZ3xdckzOjQDD0YiG
=M2pE
-END PGP SIGNATURE-

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH v2] ensure function declarations are compiled with their definitions

2017-08-18 Thread Antonio Quartulli
From: Antonio Quartulli 

Function prototypes should be included when compiling their
definitions so that it is clear to compilers and static
analyzers that they are not static.

This means that several declarations have to be moved to the
related header files which in turn have to be included by the
source files implementing them.

Generally speaking this also improves the coding style and
makes this code more consistent with the rest that already
follows this rule.

Signed-off-by: Antonio Quartulli 
---

v2: rebased on top of latest master to avoid conflict

 src/openvpn/crypto.h |  3 +++
 src/openvpn/error.c  |  3 +--
 src/openvpn/forward-inline.h | 28 ++--
 src/openvpn/forward.h| 35 +++
 src/openvpn/init.h   |  2 ++
 src/openvpn/lladdr.c |  1 +
 src/openvpn/manage.h | 11 ++-
 src/openvpn/mbuf.h   |  4 ++--
 src/openvpn/mroute.h | 21 +++--
 src/openvpn/multi.h  |  7 +++
 src/openvpn/occ-inline.h |  8 ++--
 src/openvpn/occ.h|  6 ++
 src/openvpn/pf-inline.h  |  6 ++
 src/openvpn/pf.h |  6 ++
 src/openvpn/ping-inline.h|  6 ++
 src/openvpn/ping.h   |  4 
 src/openvpn/plugin.h |  2 ++
 src/openvpn/socket.h | 13 +++--
 18 files changed, 97 insertions(+), 69 deletions(-)

diff --git a/src/openvpn/crypto.h b/src/openvpn/crypto.h
index f1b6c20a..5f0790a6 100644
--- a/src/openvpn/crypto.h
+++ b/src/openvpn/crypto.h
@@ -467,6 +467,9 @@ void prng_bytes(uint8_t *output, int len);
 
 void prng_uninit(void);
 
+/* an analogue to the random() function, but use prng_bytes */
+long int get_random(void);
+
 void test_crypto(struct crypto_options *co, struct frame *f);
 
 
diff --git a/src/openvpn/error.c b/src/openvpn/error.c
index 04bf0da5..e885ec3b 100644
--- a/src/openvpn/error.c
+++ b/src/openvpn/error.c
@@ -31,6 +31,7 @@
 
 #include "error.h"
 #include "buffer.h"
+#include "init.h"
 #include "misc.h"
 #include "win32.h"
 #include "socket.h"
@@ -734,8 +735,6 @@ openvpn_exit(const int status)
 {
 if (!forked)
 {
-void tun_abort();
-
 #ifdef ENABLE_PLUGIN
 void plugin_abort(void);
 
diff --git a/src/openvpn/forward-inline.h b/src/openvpn/forward-inline.h
index ab83ea40..04601e8c 100644
--- a/src/openvpn/forward-inline.h
+++ b/src/openvpn/forward-inline.h
@@ -24,6 +24,8 @@
 #ifndef FORWARD_INLINE_H
 #define FORWARD_INLINE_H
 
+#include "forward.h"
+
 /*
  * Inline functions
  */
@@ -35,8 +37,6 @@ static inline void
 check_tls(struct context *c)
 {
 #if defined(ENABLE_CRYPTO)
-void check_tls_dowork(struct context *c);
-
 if (c->c2.tls_multi)
 {
 check_tls_dowork(c);
@@ -52,10 +52,6 @@ static inline void
 check_tls_errors(struct context *c)
 {
 #if defined(ENABLE_CRYPTO)
-void check_tls_errors_co(struct context *c);
-
-void check_tls_errors_nco(struct context *c);
-
 if (c->c2.tls_multi && c->c2.tls_exit_signal)
 {
 if (link_socket_connection_oriented(c->c2.link_socket))
@@ -84,8 +80,6 @@ static inline void
 check_incoming_control_channel(struct context *c)
 {
 #if P2MP
-void check_incoming_control_channel_dowork(struct context *c);
-
 if (tls_test_payload_len(c->c2.tls_multi) > 0)
 {
 check_incoming_control_channel_dowork(c);
@@ -100,8 +94,6 @@ check_incoming_control_channel(struct context *c)
 static inline void
 check_connection_established(struct context *c)
 {
-void check_connection_established_dowork(struct context *c);
-
 if (event_timeout_defined(&c->c2.wait_for_connect))
 {
 check_connection_established_dowork(c);
@@ -114,8 +106,6 @@ check_connection_established(struct context *c)
 static inline void
 check_add_routes(struct context *c)
 {
-void check_add_routes_dowork(struct context *c);
-
 if (event_timeout_trigger(&c->c2.route_wakeup, &c->c2.timeval, 
ETT_DEFAULT))
 {
 check_add_routes_dowork(c);
@@ -128,8 +118,6 @@ check_add_routes(struct context *c)
 static inline void
 check_inactivity_timeout(struct context *c)
 {
-void check_inactivity_timeout_dowork(struct context *c);
-
 if (c->options.inactivity_timeout
 && event_timeout_trigger(&c->c2.inactivity_interval, &c->c2.timeval, 
ETT_DEFAULT))
 {
@@ -142,8 +130,6 @@ check_inactivity_timeout(struct context *c)
 static inline void
 check_server_poll_timeout(struct context *c)
 {
-void check_server_poll_timeout_dowork(struct context *c);
-
 if (c->options.ce.connect_timeout
 && event_timeout_trigger(&c->c2.server_poll_interval, &c->c2.timeval, 
ETT_DEFAULT))
 {
@@ -157,8 +143,6 @@ check_server_poll_timeout(struct context *c)
 static inline void
 check_scheduled_exit(struct context *c)
 {
-void check_scheduled_exit_dowork(struct context *c);
-
 if (event_timeout_defined(&c->c2.scheduled_exit))
 {
 if (event_timeout_trigger(&c->c2.schedu