Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jan 2024 09:21:36 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 276583] openvpn DSO: sys/net/if_ovpn.c return ENOSPC, need: ENOBUF
Message-ID:  <bug-276583-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276583

            Bug ID: 276583
           Summary: openvpn DSO: sys/net/if_ovpn.c return ENOSPC, need:
                    ENOBUF
           Product: Base System
           Version: 14.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: root.rnd@gmail.com

Created attachment 247920
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D247920&action=
=3Dedit
debug src if_ovpn.c and openvpn

**Describe the bug**
1. openvpn send short buffer in ioctl().=20
2. sys/net/if_ovpn.c return **ENOSPC**, need: **ENOBUF**

in openvpn.log messange=20

`2024-01-20 10:50:14 xxxxxx/aaaaa:45216 dco_update_peer_stat: invalid peer =
ID 2
returned by kernel`

**To Reproduce**
clean install from ports


**Version information **
```
root@-14:/ # pkg info -x openvpn
openvpn-2.6.8_1
```
```
root@-14:/usr/local/etc/wireguard # uname -a
FreeBSD gw-de-14 14.0-RELEASE FreeBSD 14.0-RELEASE #0
releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:23 UTC 2023=20=20=20=20
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

```

**Additional context**
debug in freebsd:

```
root@-14:/ # cd /tmp/
root@-14:/tmp # fetch http://www.grosbein.net/freebsd/patches/if_ovpn.c.diff
if_ovpn.c.diff 1133 B 6916 kBps 00s
root@-14:/tmp # cd /usr/src/sys/net
=E2=80=8B
root@-14:/usr/src/sys/net # patch < /tmp/if_ovpn.c.diff
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- if_ovpn.c.orig 2023-11-10 07:07:53.000000000 +0700
|+++ if_ovpn.c 2024-01-19 22:30:53.478336000 +0700
--------------------------
Patching file if_ovpn.c using Plan A...
Hunk #1 succeeded at 48.
Hunk #2 succeeded at 277.
Hunk #3 succeeded at 1419.
done
root@-14:/usr/src/sys/net # cd /usr/src/sys/modules/if_ovpn
root@-14:/usr/src/sys/modules/if_ovpn # make
[Creating objdir /usr/obj/usr/src/amd64.amd64/sys/modules/if_ovpn...]
machine -> /usr/src/sys/amd64/include
......skip
root@-14:/usr/src/sys/modules/if_ovpn # service openvpn stop
Stopping openvpn.
Waiting for PIDS: 52148.
root@-14:/usr/src/sys/modules/if_ovpn # kldunload if_ovpn
root@-14:/usr/src/sys/modules/if_ovpn # kldload
/usr/obj/usr/src/amd64.amd64/sys/modules/if_ovpn/if_ovpn.ko
root@-14:/usr/src/sys/modules/if_ovpn # service openvpn start
Starting openvpn.
root@-14:/usr/src/sys/modules/if_ovpn # sysctl net.link.openvpn.debug=3D1
net.link.openvpn.debug: 0 -> 1

**in /var/log/debug.log**


root@-14:/usr/local/etc/wireguard # tail -f /var/log/debug.log
Jan 22 17:29:26 -14 kernel: if_ovpn: len(4594) > ifd->ifd_len(4096)
Jan 22 17:30:06 -14 syslogd: last message repeated 1 times
Jan 22 17:32:07 -14 syslogd: last message repeated 2 times
Jan 22 17:35:07 -14 syslogd: last message repeated 3 times
Jan 22 17:35:59 -14 kernel: if_ovpn: len(4269) > ifd->ifd_len(4096)
Jan 22 17:36:07 -14 syslogd: last message repeated 1 times
Jan 22 17:38:07 -14 syslogd: last message repeated 2 times
Jan 22 17:41:07 -14 syslogd: last message repeated 3 times
Jan 22 18:16:21 -14 syslogd: last message repeated 1 times
Jan 22 18:21:25 -14 syslogd: last message repeated 5 times
```
correction, patch opepvpn in FreeBSD14:

cd /usr/ports/security/openvpn/files
fetch http://www.grosbein.net/freebsd/patches/patch-src_openvpn_dco__freebs=
d.c
cd ..
make clean all deinstall install

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-276583-227>