Skip to content

Commit

Permalink
libnetmap: remove interface name validation
Browse files Browse the repository at this point in the history
When trying to use a VLAN device (e.g. "em0.123") with a dot
the library fails to parse the interface correctly. The former
pattern is much too restrictive given that almost all characters
can be coerced into a device name via ifconfig.

Remove the particularly restrictive validation.  Some characters
still cannot be used as an interface name as they are used as
delimiters in the syntax, but this allows to be able to use most
of them without an issue.

Submitted by:	[email protected]
Differential Revision:	https://reviews.freebsd.org/D42485
Reviewed by:	vmaffione
  • Loading branch information
Vincenzo Maffione authored and Vincenzo Maffione committed Dec 21, 2023
1 parent 64db9a0 commit ad87454
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/libnetmap/nmreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ nmreq_header_decode(const char **pifname, struct nmreq_header *h, struct nmctx *
for (pipesep = vpname; pipesep != scan && !index("{}", *pipesep); pipesep++)
;

if (!nm_is_identifier(vpname, pipesep)) {
nmctx_ferror(ctx, "%s: invalid port name '%.*s'", *pifname,
pipesep - vpname, vpname);
goto fail;
}
if (pipesep != scan) {
pipesep++;
if (*pipesep == '\0') {
Expand Down

0 comments on commit ad87454

Please sign in to comment.