dial-reference icon indicating copy to clipboard operation
dial-reference copied to clipboard

Fix several issues in server's get_local_address()

Open ivangalkin opened this issue 4 years ago • 0 comments

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

ivangalkin avatar Oct 30 '21 23:10 ivangalkin