Bug 61 - Won't accept long, but permitted interface names
Summary: Won't accept long, but permitted interface names
Status: RESOLVED FIXED
Alias: None
Product: passt
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux
: Normal normal
Assignee: David Gibson
URL:
Depends on:
Blocks:
 
Reported: 2023-06-28 03:44 UTC by David Gibson
Modified: 2023-06-29 00:41 UTC (History)
0 users

See Also:


Attachments

Description David Gibson 2023-06-28 03:44:08 UTC
Interface names must fit in a buffer of size IFNAMSIZ (16) including a trailing \0, so they must be 15 or less characters.

A) 
Passt has an off by one error in the checking for the -I option meaning that it will only accept interface names of 14 or less characters.

  To reproduce:

1. ./pasta -I foo456789abcdef

  Expected results: pasta works normally
  Actual results: "Invalid interface name: foo456789abcdef"

B)

In conf_ports() we have the same error, plus some additional ones, meaning we only accept interface names of 12 or less characters.

  To reproduce:

1. ./pasta -I foo456789abcd --config-net
    To create an environment with a 13 character name
2. ./pasta -t %foo456789abcd/8000

    Expected results: inner pasta works normally
    Actual results: "Invalid port specifier %foo456789abcd/8000"
Comment 1 David Gibson 2023-06-28 03:45:19 UTC
I hit this for real on my laptop, where the dock ethernet device is "enp34s0u2u1u2" (13 characters).
Comment 2 David Gibson 2023-06-28 06:50:44 UTC
Fix posted on mailing list.
Comment 3 David Gibson 2023-06-29 00:41:49 UTC
Fix is now merged.

Note You need to log in before you can comment on or make changes to this bug.