From: "cron2 (Code Review)" Date: Tue, 4 Nov 2025 21:44:18 +0000 References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="GznoqebD5sE="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: dco_freebsd.c: add D_DCO_DEBUG messages for counters and notifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --GznoqebD5sE= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1349?usp=3Demail to review the following change. Change subject: dco_freebsd.c: add D_DCO_DEBUG messages for counters and no= tifications ...................................................................... dco_freebsd.c: add D_DCO_DEBUG messages for counters and notifications Some of these debug messages only existed on Linux, and made debugging DCO issues on FreeBSD more difficult. Add them, using the same style as used for dco_linux.c Change-Id: Ife55cb78401dad921b75f6c86d9bd0642f6a6e83 Signed-off-by: Gert Doering --- M src/openvpn/dco_freebsd.c 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/49/1349/1 diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index 3521fca..e4cb71a 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -577,6 +577,9 @@ mi->context.c2.dco_read_bytes =3D nvlist_get_number(nvl, "in"); mi->context.c2.dco_write_bytes =3D nvlist_get_number(nvl, "out"); + + msg(D_DCO_DEBUG, "%s: peer-id %d, dco_read_bytes: " counter_format " d= co_write_bytes: " counter_format, + __func__, peerid, mi->context.c2.dco_read_bytes, mi->context.c2.dc= o_write_bytes); } int @@ -614,6 +617,7 @@ dco->dco_message_peer_id =3D nvlist_get_number(nvl, "peerid"); type =3D nvlist_get_number(nvl, "notification"); + switch (type) { case OVPN_NOTIF_DEL_PEER: @@ -631,6 +635,8 @@ dco->dco_del_peer_reason =3D OVPN_DEL_PEER_REASON_USER= SPACE; } } + msg(D_DCO_DEBUG, "%s: received NOTIF_DEL_PEER for peer-id=3D%d= , reason=3D%d", __func__, + dco->dco_message_peer_id, dco->dco_del_peer_reason); if (nvlist_exists_nvlist(nvl, "bytes")) { @@ -651,6 +657,8 @@ break; case OVPN_NOTIF_ROTATE_KEY: + msg(D_DCO_DEBUG, "%s: received NOTIF_ROTATE_KEY for peer-id=3D= %d", __func__, + dco->dco_message_peer_id); dco->dco_message_type =3D OVPN_CMD_SWAP_KEYS; break; @@ -670,12 +678,14 @@ msg(M_WARN, "Failed to parse float notification"); break; } + msg(D_DCO_DEBUG, "%s: received NOTIF_FLOAT for peer-id=3D%d", = __func__, + dco->dco_message_peer_id); dco->dco_message_type =3D OVPN_CMD_FLOAT_PEER; break; } default: - msg(M_WARN, "Unknown kernel notification %d", type); + msg(M_WARN, "%s: unknown kernel notification %d", __func__, ty= pe); break; } @@ -815,6 +825,8 @@ return 0; } + msg(D_DCO_DEBUG, __func__); + CLEAR(drv); snprintf(drv.ifd_name, IFNAMSIZ, "%s", dco->ifname); drv.ifd_cmd =3D OVPN_GET_PEER_STATS; @@ -873,6 +885,7 @@ int dco_get_peer_stats(struct context *c, const bool raise_sigusr1_on_err) { + msg(D_DCO_DEBUG, __func__); /* Not implemented. */ return 0; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1349?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ife55cb78401dad921b75f6c86d9bd0642f6a6e83 Gerrit-Change-Number: 1349 Gerrit-PatchSet: 1 Gerrit-Owner: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld --GznoqebD5sE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld, plaisthos.

cron2 would like plaisthos and flichtenheld to review t= his change.

V= iew Change

dco_freebsd.c: add D_DCO_DEBUG messages for=
 counters and notifications

Some of these debug messages only existe= d on Linux, and made debugging
DCO issues on FreeBSD more difficult. Ad= d them, using the same style as
used for dco_linux.c

Change-Id: I= fe55cb78401dad921b75f6c86d9bd0642f6a6e83
Signed-off-by: Gert Doering <= ;gert@...1296...>
---
M src/openvpn/dco_freebsd.c
1 file change= d, 14 insertions(+), 1 deletion(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/49/1349/1
diff --=
git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c
index 3521fca..e4cb71a 100644
--- a/src/openvpn/dco_freebs= d.c
+++ b/src/openvpn/dco_freebsd.c
@@ -577= ,6 +577,9 @@

mi->context.c2.dco_r= ead_bytes =3D nvlist_get_number(nvl, "in");
= mi->context.c2.dco_write_bytes =3D nvlist_get_number(nvl, "out"= ;);
+
+ msg(D_DCO_DEBUG, "%s: peer= -id %d, dco_read_bytes: " counter_format " dco_write_bytes: "= ; counter_format,
+ = __func__, peerid, mi->context.c2.dco_read_bytes, mi->context.c2= .dco_write_bytes);
}

in= t
@@ -614,6 +617,7 @@
dco->dco_mess= age_peer_id =3D nvlist_get_number(nvl, "peerid");

type =3D nvlist_get_number(nvl, "notification&= quot;);
+
<= span> switch (type)
{
cas= e OVPN_NOTIF_DEL_PEER:
@@ -631,6 +635,8 @@
= dco->dco_del_peer_reason =3D OVPN_DEL_PEER_REASON_U= SERSPACE;
}
}=
+ msg(D_D= CO_DEBUG, "%s: received NOTIF_DEL_PEER for peer-id=3D%d, reason=3D%d&q= uot;, __func__,
+ = dco->dco_message_peer_id, dco->dco_del_peer_reason);

if (nvlist_exists_nvlist(nvl, &q= uot;bytes"))
{
@@ -651,6 = +657,8 @@
break;

<= span> case OVPN_NOTIF_ROTATE_KEY:

+ msg(D_DCO_DEBUG, "%s: received NOTIF= _ROTATE_KEY for peer-id=3D%d", __func__,
+ dco->dco_message_peer_id);
dco->dco_message_type =3D OVPN_CMD_SWAP_KEYS;<= /span>
break;

@@ -6= 70,12 +678,14 @@
msg(M_WARN, "Failed = to parse float notification");
break;=
}
+ msg(D_DCO_DEBUG, "%s: received NOTIF_FLOAT for= peer-id=3D%d", __func__,
+ dco->dco_message_peer_id);
= dco->dco_message_type =3D OVPN_CMD_FLOAT_PEER;
break;

}
default:
- msg(M_WARN, "Unknown kernel notification %d", typ= e);
+ msg(= M_WARN, "%s: unknown kernel notification %d", __func__, type);
break;
}
<= /span>
@@ -815,6 +825,8 @@
return 0;
}

+ msg(D_DCO_DEBUG, __func__);
+
CLEAR(drv);
snprintf(drv.ifd_name, IFNAMSIZ, "%s", dco->ifname);<= /span>
drv.ifd_cmd =3D OVPN_GET_PEER_STATS;
@= @ -873,6 +885,7 @@
int
dco_get_peer_stats= (struct context *c, const bool raise_sigusr1_on_err)
{
+ msg(D_DCO_DEBUG, __= func__);
/* Not implemented. */
r= eturn 0;
}

To view, vi= sit chan= ge 1349. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife55cb78401dad921b75f6c86d9= bd0642f6a6e83
Gerrit-Change-Number: 1349
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --GznoqebD5sE=--