Skip to content

Conversation

@ivangalkin
Copy link

Implementation of get_local_address() has several issues:

  1. It resets the IP address (ip_addr) for every interface event if it's not the matching one. Solution - store address in a temporary variable (required because every next call to ioctl() will reset ifc.ifc_req[i]) and use it only for correct interface.
  2. It terminates on every ioctl() error, although it is not guaranteed that ioctl()will always return 0. E.g. some interface might fail with Device not configured. Solution - just skip the interface instead of terminating.
  3. It accepts all interfaces, event turned off or unplugged. No check whether interface supports multicast is performed. Solution - introduce corresponding filtering

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.

1 participant