Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20221213225430.1892940-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25680.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 63f838e384df3fb644bdeae6ede777b54dc968db)
| ... | ... |
@@ -55,8 +55,8 @@ dco_install_key(struct tls_multi *multi, struct key_state *ks, |
| 55 | 55 |
const char *ciphername) |
| 56 | 56 |
|
| 57 | 57 |
{
|
| 58 |
- msg(D_DCO_DEBUG, "%s: peer_id=%d keyid=%d", __func__, multi->dco_peer_id, |
|
| 59 |
- ks->key_id); |
|
| 58 |
+ msg(D_DCO_DEBUG, "%s: peer_id=%d keyid=%d, currently %d keys installed", |
|
| 59 |
+ __func__, multi->dco_peer_id, ks->key_id, multi->dco_keys_installed); |
|
| 60 | 60 |
|
| 61 | 61 |
/* Install a key in the PRIMARY slot only when no other key exist. |
| 62 | 62 |
* From that moment on, any new key will be installed in the SECONDARY |
| ... | ... |
@@ -181,8 +181,18 @@ dco_update_keys(dco_context_t *dco, struct tls_multi *multi) |
| 181 | 181 |
*/ |
| 182 | 182 |
if (primary->dco_status == DCO_INSTALLED_SECONDARY) |
| 183 | 183 |
{
|
| 184 |
- msg(D_DCO_DEBUG, "Swapping primary and secondary keys, now: id1=%d id2=%d", |
|
| 185 |
- primary->key_id, secondary ? secondary->key_id : -1); |
|
| 184 |
+ if (secondary) |
|
| 185 |
+ {
|
|
| 186 |
+ msg(D_DCO_DEBUG, "Swapping primary and secondary keys to " |
|
| 187 |
+ "primary-id=%d secondary-id=%d", |
|
| 188 |
+ primary->key_id, secondary->key_id); |
|
| 189 |
+ } |
|
| 190 |
+ else |
|
| 191 |
+ {
|
|
| 192 |
+ msg(D_DCO_DEBUG, "Swapping primary and secondary keys to" |
|
| 193 |
+ "primary-id=%d secondary-id=(to be deleted)", |
|
| 194 |
+ primary->key_id); |
|
| 195 |
+ } |
|
| 186 | 196 |
|
| 187 | 197 |
int ret = dco_swap_keys(dco, multi->dco_peer_id); |
| 188 | 198 |
if (ret < 0) |
| ... | ... |
@@ -216,9 +216,15 @@ dco_new_peer(dco_context_t *dco, unsigned int peerid, int sd, |
| 216 | 216 |
struct sockaddr *localaddr, struct sockaddr *remoteaddr, |
| 217 | 217 |
struct in_addr *remote_in4, struct in6_addr *remote_in6) |
| 218 | 218 |
{
|
| 219 |
- msg(D_DCO_DEBUG, "%s: peer-id %d, fd %d", __func__, peerid, sd); |
|
| 220 |
- |
|
| 221 | 219 |
struct gc_arena gc = gc_new(); |
| 220 |
+ const char *remotestr = "[undefined]"; |
|
| 221 |
+ if (remoteaddr) |
|
| 222 |
+ {
|
|
| 223 |
+ remotestr = print_sockaddr(remoteaddr, &gc); |
|
| 224 |
+ } |
|
| 225 |
+ msg(D_DCO_DEBUG, "%s: peer-id %d, fd %d, remote addr: %s", __func__, |
|
| 226 |
+ peerid, sd, remotestr); |
|
| 227 |
+ |
|
| 222 | 228 |
struct nl_msg *nl_msg = ovpn_dco_nlmsg_create(dco, OVPN_CMD_NEW_PEER); |
| 223 | 229 |
struct nlattr *attr = nla_nest_start(nl_msg, OVPN_ATTR_NEW_PEER); |
| 224 | 230 |
int ret = -EMSGSIZE; |