Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac address lookups may throw Not_found #32

Open
MagnusS opened this issue Aug 24, 2020 · 0 comments
Open

Mac address lookups may throw Not_found #32

MagnusS opened this issue Aug 24, 2020 · 0 comments

Comments

@MagnusS
Copy link
Member

MagnusS commented Aug 24, 2020

If the network interface isn't registered in the backend a call to mac will throw Not_found. This can happen if a previously registered netif has called Vnetif.disconnect and a background process attempts to send more ethernet frames with Ethernet.write. See also discussion in mirage/mirage-tcpip#428

It's not clear what the best way to fail here would be, as the mac function has to return an address or raise an exception. Options to consider:

  1. Return generated mac or a fixed mac -- random mac addresses may be hard to debug in recorded pcap data, and will later most likely cause a new exception in a call to write
  2. Remember original mac even after calls to disconnect/unregister so mac wouldn't fail. This also requires an update to write to drop packets without a valid source
  3. Throw a more useful exception
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

No branches or pull requests

1 participant