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

Fix missing error codes when NO_SOCK and USER_IO are in use #8157

Closed
wants to merge 1 commit into from

Conversation

redbaron
Copy link
Contributor

@redbaron redbaron commented Nov 7, 2024

Description

Functions in wolfio.c unconditionally reference SOCKET_* error codes, even if errno.h is conditionally included in wolfio.h.

When compiled with at least WOLFSSL_NO_SOCK + WOLFSSO_USER_IO wolfio.h decides not to include errno.h and therefore SOCKET_* symbols are missing.

Instead of changing "decision tree" in wolfio.h and risking breaking it on platforms I couldn't test, use "last resort" include of 'errno.h' in the wolfio.c if configure process detected its presence.

Testing

Built with WOLFSSL_USER_IO and WOLFSSL_NO_SOCK

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

Functions in `wolfio.c` unconditionally reference SOCKET_* error
codes, even if `errno.h` is conditionally includes in wolfio.h.

When compiled with at least WOLFSSL_NO_SOCK + WOLFSSO_USER_IO
`wolfio.h` decides not to include `errno.h` and therefore SOCKET_* symbols
are missing.

Instead of changing "decision tree" in `wolfio.h` and
risking breaking it on platforms I couldn't test, use "last resort"
include of 'errno.h' in the wolfio.c if configure process detected
its presence.
@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Nov 7, 2024

Hi @redbaron,

Thank you for this PR. I do not see you are an approved contributor. For such a small change we will likely treat as a bug report, attempt to reproduce and fix ourselves. Can you tell us more about your project?

Thanks, David Garske, wolfSSL

@embhorn
Copy link
Member

embhorn commented Nov 12, 2024

@redbaron is approved as a wolfSSL contributor

@douzzer douzzer mentioned this pull request Nov 17, 2024
@douzzer
Copy link
Contributor

douzzer commented Nov 17, 2024

fixed by #8195 -- thank you @redbaron for getting the ball rolling on this!

@douzzer douzzer closed this Nov 17, 2024
@redbaron redbaron deleted the errno-no-sock branch November 18, 2024 09:48
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.

5 participants