Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
Re: wg(4) logging enhancement - revised patch
To:
ng2d68@proton.me, mvs@openbsd.org, tech@openbsd.org
Date:
Thu, 23 Jan 2025 07:32:04 +0000

Download raw body.

Thread
On 2025/01/22 23:46, Kirill A. Korinsky wrote:
> On Wed, 22 Jan 2025 22:36:23 +0100,
> Lloyd <ng2d68@proton.me> wrote:
> > 
> > @@ -1238,8 +1260,12 @@ wg_send_initiation(void *_peer)
> >  	if (wg_timers_check_handshake_last_sent(&peer->p_timers) != ETIMEDOUT)
> >  		return;
> >  
> > -	DPRINTF(peer->p_sc, "Sending handshake initiation to peer %llu\n",
> > -	    peer->p_id);
> > +	char ipaddr[INET6_ADDRSTRLEN];
> > +	
> > +	WGPRINTF(LOG_INFO, peer->p_sc, &peer->p_endpoint_mtx, "Sending "
> > +	    "handshake initiation to peer %llu (%s)\n", peer->p_id,
> > +	    sockaddr_ntop(&peer->p_endpoint.e_remote.r_sa, ipaddr,
> > +	        sizeof(ipaddr)));
> 
> I think you should move a declaration of ipaddr to the begining of the
> functio, to match the style. Like you did it before.

Not just to match style - it will be rejected by some compilers.