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

Port server to Darwin: enable detection of MAC address over ioctl()

Open ivangalkin opened this issue 4 years ago • 0 comments

This PR makes server to be compilable on Darwin (as well as on BSD-like systems). The PR https://github.com/Netflix/dial-reference/pull/50 is required in order DIAL server to be able to start correctly. Server serves multicast & HTTP requests correctly. Unfortunately detection of "applications" doesn't works since it's based on the /proc/ file system.

Nevertheless I believe it's worth enabling the server on Darwin, since it allows at least some rudimentary testing.

P.S. faking SIOCGIFHWADDR is a hack but seems to be stable due to OS's backwards compatibility. Implementation of the IP/MAC detection via getifaddrs() would be more preferable. However even it doesn't guarantee portability and requires distinguishing between AF_PACKET/AF_LINK (and sockaddr_ll/sockaddr_dl respectively).

ivangalkin avatar Oct 31 '21 00:10 ivangalkin