Re: snmpd [12/16]: Make ab_range in application_agentx explicit 1

2023-10-24 Thread Theo Buehler
On Tue, Oct 17, 2023 at 03:21:45PM +0200, Martijn van Duren wrote:
> appl_agentx_session doesn't set ab_range explicitly to 1, and thus
> relies on malloc randomness to set it. Sit it explicitly.

ok, but I haven't verified that all the session's members are now
initialized.

> 
> OK?
> 
> martijn@
> 
> diff --git a/application_agentx.c b/application_agentx.c
> index 680725d..79900d6 100644
> --- a/application_agentx.c
> +++ b/application_agentx.c
> @@ -548,6 +548,7 @@ appl_agentx_open(struct appl_agentx_connection *conn, 
> struct ax_pdu *pdu)
>   session->sess_backend.ab_cookie = session;
>   session->sess_backend.ab_retries = 0;
>   session->sess_backend.ab_fn = _agentx_functions;
> + session->sess_backend.ab_range = 1;
>   RB_INIT(&(session->sess_backend.ab_requests));
>   TAILQ_INSERT_TAIL(&(conn->conn_sessions), session, sess_conn_entry);
>  
> 



snmpd [12/16]: Make ab_range in application_agentx explicit 1

2023-10-17 Thread Martijn van Duren
appl_agentx_session doesn't set ab_range explicitly to 1, and thus
relies on malloc randomness to set it. Sit it explicitly.

OK?

martijn@

diff --git a/application_agentx.c b/application_agentx.c
index 680725d..79900d6 100644
--- a/application_agentx.c
+++ b/application_agentx.c
@@ -548,6 +548,7 @@ appl_agentx_open(struct appl_agentx_connection *conn, 
struct ax_pdu *pdu)
session->sess_backend.ab_cookie = session;
session->sess_backend.ab_retries = 0;
session->sess_backend.ab_fn = _agentx_functions;
+   session->sess_backend.ab_range = 1;
RB_INIT(&(session->sess_backend.ab_requests));
TAILQ_INSERT_TAIL(&(conn->conn_sessions), session, sess_conn_entry);