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

[include/posix] Fix incorrect casting of timeval on zsock_timeval. #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kkasperczyk-no
Copy link
Owner

Current implementation of select() method wrongly assumes that
timeval type can be directly casted into zsock_timeval, while it's
true only when using CONFIG_NET_SOCKETS_POSIX_NAMES. In other case
i.e. using CONFIG_POSIX_API, timeval is provided by standard lib
and mentioned two structure types have fields of different size,
what leads to assigning them incorrect values.

Signed-off-by: Kamil Kasperczyk [email protected]

@kkasperczyk-no kkasperczyk-no force-pushed the timeval_fix branch 3 times, most recently from 3edb369 to 56154d8 Compare November 10, 2020 14:57
Copy link
Collaborator

@Damian-Nordic Damian-Nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Current implementation of select() method wrongly assumes that
timeval type can be directly casted into zsock_timeval, while it's
true only when using CONFIG_NET_SOCKETS_POSIX_NAMES. In other case
i.e. using CONFIG_POSIX_API, timeval is provided by standard lib
and mentioned two structure types have fields of different size,
what leads to assigning them incorrect values.

Signed-off-by: Kamil Kasperczyk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants