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

ifdef out all code in isDGramSock() when WOLFSSL_NO_SOCK defined. #8197

Closed
wants to merge 1 commit into from

Conversation

anhu
Copy link
Member

@anhu anhu commented Nov 18, 2024

In that case, simply return false.

Fixes ZD18962

@anhu anhu assigned anhu and wolfSSL-Bot and unassigned anhu Nov 18, 2024
Copy link
Contributor

@JacobBarthelmeh JacobBarthelmeh left a comment

Choose a reason for hiding this comment

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

Am not clear on how this case could be hit. Lets dig into the defines used when compiling to make sure we have a complete fix.

@JacobBarthelmeh
Copy link
Contributor

The relevant user_settings.h defines are:

WOLFSSL_DTLS
WOLFSSL_NO_SOCK
USE_WOLFSSL_IO

If allowing WOLFSSL_NO_SOCK and USE_WOLFSSL_IO at the same time then we need to have isDGramSock return correctly.

Previous versions (back to v5.4.0) we did the following in EmbedSendTo and did not have a isDGramSock internal API:

    if (getsockopt(sd, SOL_SOCKET, SO_TYPE, &type, &length) == 0 &&             
            type != SOCK_DGRAM) {                                               
        /* Probably a TCP socket. peer and peerSz MUST be NULL and 0 */         
    }  

I think a more complete fix is either we make an assumption on the type for XSOCKOPT_TYPE_OPTVAL_TYPE when not already defined. Or if the user is setting up custom socket calls with they define it.

With either fix though we should add a user_settings.h config file to our CI testing that builds this use case if supporting it going forward.

@anhu
Copy link
Member Author

anhu commented Nov 20, 2024

Closing. This will be handled by another engineer.

@anhu anhu closed this Nov 20, 2024
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.

3 participants