"Fossies" - the Fresh Open Source Software Archive

Member "ipfire-2.x-2.27-core174/src/patches/collectd/0019-openvpn-Ignore-not-fully-established-connections.patch" (7 Apr 2023, 1701 Bytes) of package /linux/misc/ipfire-2.x-2.27-core174.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 From a45710a5a887d25ab0e04ce1553bb268013ef780 Mon Sep 17 00:00:00 2001
    2 From: Michael Tremer <michael.tremer@ipfire.org>
    3 Date: Tue, 16 Sep 2014 14:44:42 +0200
    4 Subject: [PATCH 19/22] openvpn: Ignore not fully established connections
    5 
    6 ---
    7  src/openvpn.c | 15 +++++++++++++++
    8  1 file changed, 15 insertions(+)
    9 
   10 diff --git a/src/openvpn.c b/src/openvpn.c
   11 index 9598abc..6a0ffbd 100644
   12 --- a/src/openvpn.c
   13 +++ b/src/openvpn.c
   14 @@ -292,6 +292,10 @@ static int multi1_read (char *name, FILE *fh)
   15         if (fields_num < 4)
   16             continue;
   17  
   18 +       // Ignore not yet fully established connections
   19 +       if (strcmp(fields[1], "UNDEF") == 0)
   20 +           continue;
   21 +
   22         if (collect_user_count)
   23             /* If so, sum all users, ignore the individuals*/
   24         {
   25 @@ -347,6 +351,10 @@ static int multi2_read (char *name, FILE *fh)
   26         if (strcmp (fields[0], "CLIENT_LIST") != 0)
   27             continue;
   28  
   29 +       // Ignore not yet fully established connections
   30 +       if (strcmp(fields[0], "UNDEF") == 0)
   31 +           continue;
   32 +
   33         if (collect_user_count)
   34             /* If so, sum all users, ignore the individuals*/
   35         {
   36 @@ -412,6 +420,10 @@ static int multi3_read (char *name, FILE *fh)
   37             if (strcmp (fields[0], "CLIENT_LIST") != 0)
   38                 continue;
   39  
   40 +           // Ignore not yet fully established connections
   41 +           if (strcmp(fields[0], "UNDEF") == 0)
   42 +               continue;
   43 +
   44             if (collect_user_count)
   45                 /* If so, sum all users, ignore the individuals*/
   46             {
   47 @@ -475,6 +487,9 @@ static int multi4_read (char *name, FILE *fh)
   48         if (strcmp (fields[0], "CLIENT_LIST") != 0)
   49             continue;
   50  
   51 +       // Ignore not yet fully established connections
   52 +       if (strcmp(fields[0], "UNDEF") == 0)
   53 +           continue;
   54  
   55         if (collect_user_count)
   56             /* If so, sum all users, ignore the individuals*/
   57 -- 
   58 1.9.3
   59