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=email
to review the following change.
Change subject: dco_freebsd.c: add D_DCO_DEBUG messages for counters and
notifications
......................................................................
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 <[email protected]>
---
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 = nvlist_get_number(nvl, "in");
mi->context.c2.dco_write_bytes = 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);
}
int
@@ -614,6 +617,7 @@
dco->dco_message_peer_id = nvlist_get_number(nvl, "peerid");
type = nvlist_get_number(nvl, "notification");
+
switch (type)
{
case OVPN_NOTIF_DEL_PEER:
@@ -631,6 +635,8 @@
dco->dco_del_peer_reason = OVPN_DEL_PEER_REASON_USERSPACE;
}
}
+ msg(D_DCO_DEBUG, "%s: received NOTIF_DEL_PEER for peer-id=%d,
reason=%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=%d",
__func__,
+ dco->dco_message_peer_id);
dco->dco_message_type = 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=%d",
__func__,
+ dco->dco_message_peer_id);
dco->dco_message_type = OVPN_CMD_FLOAT_PEER;
break;
}
default:
- msg(M_WARN, "Unknown kernel notification %d", type);
+ msg(M_WARN, "%s: unknown kernel notification %d", __func__, type);
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 = 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=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife55cb78401dad921b75f6c86d9bd0642f6a6e83
Gerrit-Change-Number: 1349
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel