summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-05-13 10:21:00 +0000
committermav <mav@FreeBSD.org>2015-05-13 10:21:00 +0000
commitcd74b53f5b9e40767469550eb68252ba841f9c76 (patch)
tree74f51c142d81a54bdaf67329ca802606c420333e /usr.sbin
parentf24af427aae00e8dc9b1b76043885c4f874b911b (diff)
downloadFreeBSD-src-cd74b53f5b9e40767469550eb68252ba841f9c76.zip
FreeBSD-src-cd74b53f5b9e40767469550eb68252ba841f9c76.tar.gz
MFC r281766, r281767:
Report link as up only if we managed to open tap device. It would be cool to report tap device status, but it has no such API.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c
index 32f56ee..5a9b068 100644
--- a/usr.sbin/bhyve/pci_virtio_net.c
+++ b/usr.sbin/bhyve/pci_virtio_net.c
@@ -643,8 +643,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
pci_lintr_request(pi);
- /* link always up */
- sc->vsc_config.status = 1;
+ /* Link is up if we managed to open tap device. */
+ sc->vsc_config.status = (opts == NULL || sc->vsc_tapfd >= 0);
/* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */
if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix()))
OpenPOWER on IntegriCloud