Skip to content

#244 etherload_common.c missing index - #245

Open
nobruinfo wants to merge 1 commit into
MEGA65:developmentfrom
nobruinfo:244-etherload_common.c-missing-index
Open

nobruinfo wants to merge 1 commit into
MEGA65:developmentfrom
nobruinfo:244-etherload_common.c-missing-index

Conversation

@nobruinfo

Copy link
Copy Markdown
Contributor

Fixes #244 excerpt:

Describe the bug
When using make test recent build fail because of a persistent bug in etherload_common.c. It seems no problem for make all so gcc is still building. The gtest compiler seems to check for inconsistent data type transfers and stops.

To Reproduce
Steps to reproduce the behavior:

  1. Go into the code of etherload_common.c and see:
  for (int idx = 0; idx < num_if; ++idx) {
    // creating an IPv6 UDP server socket and listen on port 4510 for incoming packets
    discoverfd[idx] = socket(AF_INET6, SOCK_DGRAM, 0);
    if (discoverfd < 0) {
    ...

The fourth line is where [idx] should be the index of discoverfd . So the condition was probably no longer met.

Expected behavior
A clear and concise description of what you expected to happen.
I probably will never be able to produce a before and after error handling as this is catching network traffic at full speed. The routine is also used in Etherload so maybe some cases where this hanged could go away.

Fix:

    if (discoverfd[idx] < 0) {

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.

mega65_ftp gtest hanging because of etherload_common.c missing index

1 participant