diff --git a/net/can/can.h b/net/can/can.h index ea67fe1c948..b2b51b778de 100644 --- a/net/can/can.h +++ b/net/can/can.h @@ -117,6 +117,10 @@ struct can_conn_s int32_t tx_deadline; # endif #endif + +#ifdef CONFIG_NET_TIMESTAMP + FAR struct socket *psock; /* Needed to get SO_TIMESTAMP value */ +#endif }; /**************************************************************************** diff --git a/net/can/can_sockif.c b/net/can/can_sockif.c index 780641f9727..60b38bba11e 100644 --- a/net/can/can_sockif.c +++ b/net/can/can_sockif.c @@ -221,6 +221,12 @@ static int can_setup(FAR struct socket *psock, int protocol) return -ENOMEM; } +#ifdef CONFIG_NET_TIMESTAMP + /* Store psock in conn se we can read the SO_TIMESTAMP value */ + + conn->psock = psock; +#endif + /* Initialize the connection instance */ conn->protocol = (uint8_t)protocol;