robur-coop / albatross

Albatross: orchestrate and manage MirageOS unikernels with Solo5
ISC License
141 stars 17 forks source link

The table of interface can be sparse #123

Closed dinosaure closed 1 year ago

dinosaure commented 1 year ago

Currently, we assume that the last ID of interfaces is equal to the number of interfaces available. But the documentation on FreeBSD and Linux say that the table of interface can be sparse. This patch is a naive one which try any ID until we found what we want or we discover all interfaces available.

The patch fix an issue on Linux (EMFILE) and properly close the nl_socket in any situation (even if the function fails).

hannesm commented 1 year ago

I'd prefer two options:

hannesm commented 1 year ago

please take a look (and eventually try it out #124) :) thanks (also for closing the netlink sockets).

hannesm commented 1 year ago

included and merged as #125