comitup icon indicating copy to clipboard operation
comitup copied to clipboard

Use MAC to generate AP/Hostname, versus Random

Open d8ahazard opened this issue 3 years ago • 1 comments

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?

d8ahazard avatar Mar 06 '22 15:03 d8ahazard

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.

davesteele avatar Mar 06 '22 19:03 davesteele