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

Compilation errors occur on Windows if UA_IPV6 is not defined #6542

Closed
2 of 7 tasks
smitha-cgi opened this issue Jun 14, 2024 · 0 comments
Closed
2 of 7 tasks

Compilation errors occur on Windows if UA_IPV6 is not defined #6542

smitha-cgi opened this issue Jun 14, 2024 · 0 comments

Comments

@smitha-cgi
Copy link

Background Information / Reproduction Steps

Change ua_architecture.h to remove the definition of UA_IPV6. The eventloop_posix_udp.c file will then fail to compile due to the Win32 setMulticastInterface method assuming that IPV6 is always enabled. The non-Windows method is OK.

Solution

Change the done statement in the setMulticastInterface method from this:

 done:
    /* Write the interface index */
    if(info->ai_family == AF_INET)
        /* MSVC documentation of struct ip_mreq: To use an interface index of 1
         * would be the same as an IP address of 0.0.0.1. */
        req->ipv4.imr_interface.s_addr = htonl(idx);
    else /* if(info->ai_family == AF_INET6) */
        req->ipv6.ipv6mr_interface = idx;
    return UA_STATUSCODE_GOOD;

To this:

 done:
    /* Write the interface index */
    if(info->ai_family == AF_INET)
        /* MSVC documentation of struct ip_mreq: To use an interface index of 1
         * would be the same as an IP address of 0.0.0.1. */
        req->ipv4.imr_interface.s_addr = htonl(idx);
#if UA_IPV6
    else /* if(info->ai_family == AF_INET6) */
        req->ipv6.ipv6mr_interface = idx;
#endif
    return UA_STATUSCODE_GOOD;

Checklist

Please provide the following information:

  • open62541 Version (release number or git tag): 1.4.1
  • Other OPC UA SDKs used (client or server):
  • Operating system: Windows 11
  • Logs (with UA_LOGLEVEL set as low as necessary) attached
  • Wireshark network dump attached
  • Self-contained code example attached
  • Critical issue
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

No branches or pull requests

2 participants