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

Not configured for off-subnet multicast - Endianness mismatch? #484

Open
nvienhuy opened this issue Oct 18, 2023 · 1 comment
Open

Not configured for off-subnet multicast - Endianness mismatch? #484

nvienhuy opened this issue Oct 18, 2023 · 1 comment

Comments

@nvienhuy
Copy link

Hi all,

The stack rejects to open a T->O multicast cycle connection with the status: Not configured for off-subnet multicast.

During a debugging session, I noticed that it fails at the off-subnet multicast routing check during the ForwardOpenRoutine. Specifically, the originator_ip value is 0xC0A8023A (translate to 192.168.2.58), the interface_ip is 0x4202A8C0 (translate to 66.2.168.192), and the interface_mask is 0x00FFFFFF (translate to 0.255.255.255).

My machine is little-endian, and I believe the stack was developed with big-endian systems in mind.

Should I call htonl() on the originator_ip or the interface_ip and the interface_mask? And where is the appropriate place to do it?

In the NetworkHandlerInitialize() function I find the following:
g_network_status.ip_address = g_tcpip.interface_configuration.ip_address;
g_network_status.network_mask = g_tcpip.interface_configuration.network_mask;

Should I do it here by changing it to:
g_network_status.ip_address = htonl(g_tcpip.interface_configuration.ip_address);
g_network_status.network_mask = htonl(g_tcpip.interface_configuration.network_mask);

@MartinMelikMerkumians
Copy link
Member

Hi,

no, the stack wasn't developed with focus on big endian.
I mainly develop on a little endian machine, and I didn't had this issue.
Data should be stored in the native endianess, however data transmission is a bit mixed in ENIP.
Most data is sent as little endian, with the exception of TCP/IP information, which is sent in big endian.

As multicasts works for me and the CT does not complain in my tests, I would assume there is another error here.

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