Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/icmp: Save poll device in icmp_poll_s #9483

Merged
merged 1 commit into from Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions net/icmp/icmp.h
Expand Up @@ -69,6 +69,7 @@ struct devif_callback_s; /* Forward reference */
struct icmp_poll_s
{
FAR struct socket *psock; /* IPPROTO_ICMP socket structure */
FAR struct net_driver_s *dev; /* Needed to free the callback structure */
FAR struct pollfd *fds; /* Needed to handle poll events */
FAR struct devif_callback_s *cb; /* Needed to teardown the poll */
};
Expand Down
3 changes: 2 additions & 1 deletion net/icmp/icmp_netpoll.c
Expand Up @@ -181,6 +181,7 @@ int icmp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds)
/* Initialize the poll info container */

info->psock = psock;
info->dev = conn->dev;
info->fds = fds;
info->cb = cb;

Expand Down Expand Up @@ -272,7 +273,7 @@ int icmp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds)
{
/* Release the callback */

icmp_callback_free(conn->dev, conn, info->cb);
icmp_callback_free(info->dev, conn, info->cb);

/* Release the poll/select data slot */

Expand Down