Robert Milkowski wrote:
> Hi,
>
> Is there any reason why names containing "-" are not allowed?
> For example:
> # dladm create-etherstub -t switch-1
> dladm: invalid link name 'switch-3'
>
> same for vnics, etc.
>
> Allowing "-" would be very user friendly I think.
>
> ?
>
As the dladm(1M) man page says:
link
A datalink, identified by a name. In general, the name
can use any alphanumeric characters (or the underscore,
_), but must start with an alphabetic character and end
with a number. A datalink name can be at most 32 charac-
ters, and the ending number must be between 0 and
4294967294 (inclusive). The ending number must not begin
with a zero. Datalink names between 3 and 8 characters
are recommended.
The underlying reason is that using a restricted character set here
allows us to combine these names with other syntaxes more easily. For
example, you could include a link name as part of an SMF URI, separated
from other parts of the URI with dashes, and you'd be guaranteed that no
valid link name could ever cause your parsing to come to grief. (That's
just one example; there are many.)
Yes, it's a trade-off between being "user friendly" and being "way too
flexible for our own good."
--
James Carlson 42.703N 71.076W <carlsonj at workingcode.com>