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

[BUG] Build failure with DNS cache disabled #1199

Closed
jackwilsdon opened this issue Oct 28, 2024 · 4 comments
Closed

[BUG] Build failure with DNS cache disabled #1199

jackwilsdon opened this issue Oct 28, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@jackwilsdon
Copy link

jackwilsdon commented Oct 28, 2024

Describe the bug

#define ipconfigUSE_DNS_CACHE 0

Removes the pcName field from ParseSet_t:

#if ( ipconfigUSE_DNS_CACHE == 1 ) || ( ipconfigDNS_USE_CALLBACKS == 1 ) || ( ipconfigUSE_MDNS == 1 )
BaseType_t xDoStore; /**< Becomes true when a DNS reply was requested by this device,
* i.e. it has a matching request ID. */
char pcName[ ipconfigDNS_CACHE_NAME_LENGTH ]; /**< A copy of the name that is mentioned in the questions. */
#endif

But pcName is still used by DNS_ReadNameField:

pxSet->pcName[ uxNameLen ] = '.';

Target

  • Development board: Raspberry Pi Pico
  • Instruction Set Architecture: ARMv6-M
  • IDE and version: N/A
  • Toolchain and version: arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009

Host

  • Host OS: Linux
  • Version: Debian GNU/Linux trixie/sid

To Reproduce

  • Set ipconfigUSE_DNS_CACHE to 0
  • Note that FreeRTOS-Plus-TCP no longer compiles

Expected behavior
FreeRTOS-Plus-TCP should compile with the DNS cache disabled.

Additional context
I'm on version 4.2.2 but can reproduce on main too.

@jackwilsdon jackwilsdon added the bug Something isn't working label Oct 28, 2024
@archigup
Copy link
Member

Hi thanks for bringing this up! We're looking into this.

@AniruddhaKanhere
Copy link
Member

Hello @jackwilsdon,

Thank you for bringing this to our attention. You are absolutely correct. This is a bug in how the #ifs are used.

The issue here is that the function DNS_ReadNameField only gets invoked when the DNS cache is enabled. But, it gets compiled with or without DNS cache being enabled. We should add a #if ( ipconfigUSE_DNS_CACHE == 1 ) around the function declaration and definition. We will raise a PR to fix it shortly.

Thanks again,
Aniruddha

@AniruddhaKanhere
Copy link
Member

Hello @jackwilsdon, the above PR #1201 is merged in. Can you verify that the fix works for you?

Thanks,
Aniruddha

@ActoryOu
Copy link
Member

ActoryOu commented Nov 5, 2024

We're closing this issue as the patch has been successfully merged. If you encounter any further related issues, please don't hesitate to reopen this thread.

@ActoryOu ActoryOu closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants