Skip to contentSkip to conversation

dco: define OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT on FreeBSD

PATCH In review Kristof Provost 3 participants 6 messages Mar 3, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dco: define OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT on FreeBSD

From: Kristof Provost <[email protected]...>

FreeBSD's if_ovpn will never emit this as a peer deletion reason (because it doesn't support TCP), but this allows us to align the defines between Linux and FreeBSD, and remove a Linux-specific case from process_incoming_del_peer().

---
 src/openvpn/dco_freebsd.h | 1 +
 src/openvpn/multi.c       | 3 ---
 2 files changed, 1 insertion(+), 3 deletions(-)
src/openvpn/dco_freebsd.h +1 -0
index 2e35f3ac..970beca0 100644
@@ -41,6 +41,7 @@ enum ovpn_del_reason_t {
     OVPN_DEL_PEER_REASON_EXPIRED,
     OVPN_DEL_PEER_REASON_TRANSPORT_ERROR,
     OVPN_DEL_PEER_REASON_USERSPACE,
+    OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT,
 };
 
 typedef struct dco_context {
src/openvpn/multi.c +0 -3
index f2559016..99123c39 100644
@@ -3244,12 +3244,9 @@ process_incoming_del_peer(struct multi_context *m, struct multi_instance *mi,
             reason = "ovpn-dco: transport error";
             break;
 
-#ifdef TARGET_LINUX
-        /* FIXME: this is linux-only today and breaks FreeBSD compilation */
         case OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT:
             reason = "ovpn-dco: transport disconnected";
             break;
-#endif
 
         case OVPN_DEL_PEER_REASON_USERSPACE:
             /* We assume that is ourselves. Unfortunately, sometimes these
Signature · 1 line
2.39.2
#1 lore raw

Hi,

Quoted 6 lines · Kristof Provost via Openvpn-devel

From: Kristof Provost <[email protected]...>

FreeBSD's if_ovpn will never emit this as a peer deletion reason (because it doesn't support TCP), but this allows us to align the defines between Linux and FreeBSD, and remove a Linux-specific case from process_incoming_del_peer().

SoB missing

Quoted 34 lines
---
  src/openvpn/dco_freebsd.h | 1 +
  src/openvpn/multi.c       | 3 ---
  2 files changed, 1 insertion(+), 3 deletions(-)
src/openvpn/dco_freebsd.h +1 -0
index 2e35f3ac..970beca0 100644
@@ -41,6 +41,7 @@ enum ovpn_del_reason_t {
      OVPN_DEL_PEER_REASON_EXPIRED,
      OVPN_DEL_PEER_REASON_TRANSPORT_ERROR,
      OVPN_DEL_PEER_REASON_USERSPACE,
+    OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT,
  };
 
  typedef struct dco_context {
src/openvpn/multi.c +0 -3
index f2559016..99123c39 100644
@@ -3244,12 +3244,9 @@ process_incoming_del_peer(struct multi_context *m, struct multi_instance *mi,
              reason = "ovpn-dco: transport error";
              break;
 
-#ifdef TARGET_LINUX
-        /* FIXME: this is linux-only today and breaks FreeBSD compilation */
          case OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT:
              reason = "ovpn-dco: transport disconnected";
              break;
-#endif
 
          case OVPN_DEL_PEER_REASON_USERSPACE:
              /* We assume that is ourselves. Unfortunately, sometimes these
Signature · 1 line
Antonio Quartulli
#2 lore raw

Hi,

Quoted 11 lines · Antonio Quartulli

Hi,

Quoted 6 lines · Kristof Provost via Openvpn-devel

From: Kristof Provost <[email protected]...>

FreeBSD's if_ovpn will never emit this as a peer deletion reason (because it doesn't support TCP), but this allows us to align the defines between Linux and FreeBSD, and remove a Linux-specific case from process_incoming_del_peer().

SoB missing

Sorry for being very condensed, however the patch looks good and gets my ACK:

I normally put my ACK under the SoB, so when I couldn't find it, my brain just threw that exception :-P

Cheers,

Quoted 35 lines
Quoted 34 lines

---
  src/openvpn/dco_freebsd.h | 1 +
  src/openvpn/multi.c       | 3 ---

  2 files changed, 1 insertion(+), 3 deletions(-)
src/openvpn/dco_freebsd.h +1 -0
index 2e35f3ac..970beca0 100644
@@ -41,6 +41,7 @@ enum ovpn_del_reason_t {
       OVPN_DEL_PEER_REASON_EXPIRED,
       OVPN_DEL_PEER_REASON_TRANSPORT_ERROR,
       OVPN_DEL_PEER_REASON_USERSPACE,
+    OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT,
   };
   typedef struct dco_context {
src/openvpn/multi.c +0 -2
index f2559016..99123c39 100644
@@ -3244,12 +3244,9 @@ process_incoming_del_peer(struct multi_context 
 *m, struct multi_instance *mi,
               reason = "ovpn-dco: transport error";
               break;
-#ifdef TARGET_LINUX
-        /* FIXME: this is linux-only today and breaks FreeBSD 

compilation */
          case OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT:
              reason = "ovpn-dco: transport disconnected"; break;
-#endif
          case OVPN_DEL_PEER_REASON_USERSPACE:
              /* We assume that is ourselves. Unfortunately, sometimes these

Signature · 1 line
Antonio Quartulli
#3 lore raw
Quoted 11 lines · Antonio Quartulli
Quoted 10 lines · Antonio Quartulli

Hi,

Quoted 6 lines · Kristof Provost via Openvpn-devel

From: Kristof Provost <[email protected]...>

FreeBSD's if_ovpn will never emit this as a peer deletion reason (because it doesn't support TCP), but this allows us to align the defines between Linux and FreeBSD, and remove a Linux-specific case from process_incoming_del_peer().

Quoted 8 lines
Quoted 1 line

SoB missing

Sorry for being very condensed, however the patch looks good and gets my ACK:

I normally put my ACK under the SoB, so when I couldn't find it, my brain just threw that exception :-P

Ah yes. Do you want me to send an update with the line included, or is this sufficient:

Kristof

#4 lore raw

Hi,

Quoted 1 line · Kristof Provost via Openvpn-devel

Ah yes. Do you want me to send an update with the line included, or is this sufficient:

Sufficient, thanks :)

gert

Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you 
 feed honest figures into a computer, honest figures come out. Never doubted 
 it myself till I met a computer with a sense of humor."
                             Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany                             [email protected]...
#5 lore raw
In reply to Kristof Provost

Thanks for the patch - I did the #ifdef variant "because I did not want to touch FreeBSD enums without checking with you first" - but this is a better way forward. Client-side tested on FreeBSD 14 and 12 :-)

Your patch has been applied to the master and release/2.6 branch.

commit 155cf11531e619cf24b2aa9d0acb4ff834b2e8fa (master) commit 7fdf3e7ad711e1583e960798848c7d7f94e1ad8a (release/2.6)

Author: Kristof Provost
Date:   Fri Mar 3 12:05:11 2023 +0100
     dco: define OVPN_DEL_PEER_REASON_TRANSPORT_DISCONNECT on FreeBSD

     Signed-off-by: Kristof Provost <[email protected]...>
     Acked-by: Antonio Quartulli <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg26324.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering