Skip to content

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

Closed
redbaron wants to merge 1 commit intowolfSSL:masterfrom
redbaron:errno-no-sock
Closed

Fix missing error codes when NO_SOCK and USER_IO are in use#8157
redbaron wants to merge 1 commit intowolfSSL:masterfrom
redbaron:errno-no-sock

Conversation

@redbaron
Copy link
Copy Markdown
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
Copy Markdown

Can one of the admins verify this patch?

@dgarske
Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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