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

Use MAC to generate AP/Hostname, versus Random #202

Open
d8ahazard opened this issue Mar 6, 2022 · 1 comment
Open

Use MAC to generate AP/Hostname, versus Random #202

d8ahazard opened this issue Mar 6, 2022 · 1 comment

Comments

@d8ahazard
Copy link
Contributor

David, just curious what you thought of this idea...

Instead of generating a new, random host name every time Comitup is first initialized, what about using uuid.getnode() and then grabbing the last 4-6 characters of the uuid and using that as the AP name?

I know MAC can be spoofed, and getnode() may return different interfaces' values based on HW configs, but it feels like this would at least be a somewhat reliable way to have the same device have the same host name every time comitup is re-initialized.

Something like this in config.py:

image

And, of course, if you wanted to keep the default behavior unless specified, we could add a bool in config "UseMac" or something that would decide whether to randomly generate the number versus using the MAC.

Thoughts?

@davesteele
Copy link
Owner

The current random value is preserved over reinstalls and upgrades (see debian/comitup.*inst in the debian branch).

It is currently removed on uninstall. It's not a bad idea to move that action to "purge".

I might be OK with a MAC option patch, but note:

  • The removed line above guarantees the length of the unique value. The new one doesn't.
  • getnode() has no "ordering guarantees". There needs to be an assurance that the ID doesn't change with the addition of a USB network adapter.
  • Collision recovery is harder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants