Skip to content

Commit

Permalink
Revert "[BACKPORT] net/can: remove psock reference from can connect"
Browse files Browse the repository at this point in the history
This reverts commit 9ce3fab.

PR reference: apache/nuttx#5467

In order for this commit to be valid, the following other PRs must also
be back-ported first:
- apache/nuttx#5434

Additional PRs that fix related bugs:
- apache/nuttx#5462
- apache/nuttx#5466
  • Loading branch information
JacobCrabill committed May 25, 2022
1 parent 86f5194 commit be60696
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/can/can.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

/****************************************************************************
Expand Down
6 changes: 6 additions & 0 deletions net/can/can_sockif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit be60696

Please sign in to comment.