On 01/08/2018 07:21, Travis Paul wrote:
In NetBSD 8 the output of ifconfig was changed and the netmask is now returned as part of the IP address[1]. Some software[2] that parses ifconfig needs to be updated to handle the new output. Is there a better way of aquiring the interfaces and addresses instead of parsing ifconfig output? Thanks, Travis [1] https://github.com/NetBSD/src/commit/46bbbdf5436cb1b2bd00829444dedbd9347a6fd1 [2] https://github.com/saltstack/salt/issues/48856
There's a python script here [1] to use libc getifaddrs(3) which avoids this issue entirely and should work across all modern platforms.
This is probably better than scraping ifconfig or similar output across platforms.
Roy [1] https://gist.github.com/provegard/1536682