Skip to content
Snippets Groups Projects
Commit daf66931 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Allow multiple MAC addresses per host in host lists.

Change the function parse_host_mac_ip_list() to handle multiple MAC
addresses, separated by comma or semicolon, in the MAC address column.
It is thus possible to write, e.g:

     smurf      ff1020-304050,ff1020-304051     192.0.2.17 192.0.2.23
     gargamel   ff10.2030.4060;ff10.2030.4061   192.0.2.240

Note that there must not be any spaces around the separators, as the
parser will then think it has transited into the IP address columns.
(It would probably be better to detect when items no longer look like
MAC addresses, but that's more work than I have time for right now,
so this will have to do.)

This can be useful for example to generate DHCP configurations where
some machines can appear with one of several MAC addresses, e.g. a
laptop that is sometimes connected with its built-in ethernet port
and sometimes using a docking station with a different MAC address.
parent be7d56e2
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment