Bug 242637 - emulators/virtualbox-ose: Fix bridging when ng_ether node name does not match interface name
Summary: emulators/virtualbox-ose: Fix bridging when ng_ether node name does not match...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Virtualbox Team (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2019-12-14 19:25 UTC by Landon J. Fuller
Modified: 2023-08-19 09:40 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (vbox)
koobs: merge-quarterly?


Attachments
Patch for current (5.2.34) emulators/virtualbox-ose (32.90 KB, patch)
2019-12-14 19:25 UTC, Landon J. Fuller
grahamperrin: maintainer-approval? (vbox)
Details | Diff
Patch for 6.1.0 emulators/virtualbox-ose (31.88 KB, patch)
2019-12-14 19:26 UTC, Landon J. Fuller
grahamperrin: maintainer-approval? (vbox)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Landon J. Fuller freebsd_committer freebsd_triage 2019-12-14 19:25:57 UTC
Created attachment 209951 [details]
Patch for current (5.2.34) emulators/virtualbox-ose

This patch fixes bridging in cases where the interface's ng_ether netgraph node name does not match its interface name.

This is commonly seen with VLANs configured in rc.conf; for example:

  ifconfig_igb0="up"
  vlans_igb0="12"

This will create an 'igb0.12' VLAN interface, but because '.' is a reserved character in netgraph node names, the corresponding netgraph node will be named 'igb0_12':

    Name: igb0_12         Type: ether           ID: 00000007   Num hooks: 0

Currently, VBoxNetFlt assumes a 1:1 correspondence between interface name and ng_ether node name; when attempting to bridge to igb0.12, the node named "igb0.12" is not found, and VBoxNetFlt's netgraph initialization silently fails.

Rather than assume the node name, this patch enumerates all ng_ether nodes, using the NGM_ETHER_GET_IFNAME control message to identify the ng_ether node corresponding to the target interface.

I've attached patches for the current emulators/virtualbox-ose port, as well as a patch relative to the 6.1 patch posted on 2019-12-13 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234878).
Comment 1 Landon J. Fuller freebsd_committer freebsd_triage 2019-12-14 19:26:37 UTC
Created attachment 209952 [details]
Patch for 6.1.0 emulators/virtualbox-ose
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2019-12-15 06:06:52 UTC
Thank you for the report and patch Landon

Can you confirm this change passes QA? (poudriere in particular)
Comment 3 Landon J. Fuller freebsd_committer freebsd_triage 2019-12-16 18:06:46 UTC
(In reply to Kubilay Kocak from comment #2)

I can confirm the 5.2.34 patch passes a `poudriere testport` run (the 6.1.0 patch does as well, after a few unrelated issues in the #234878 6.1.0 diff are resolved).