vke(4) - Show backing tap only if one was used.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Wed, 20 Feb 2013 10:26:54 +0000 (11:26 +0100)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Fri, 22 Feb 2013 01:04:48 +0000 (02:04 +0100)
sys/dev/virtual/vkernel/net/if_vke.c

index 893ebac..c09b36d 100644 (file)
@@ -390,8 +390,9 @@ vke_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr)
 
                len = strlen(ifs->ascii);
                if (len < sizeof(ifs->ascii)) {
-                       ksnprintf(ifs->ascii + len, sizeof(ifs->ascii) - len,
-                                 "\tBacked by tap%d\n", sc->sc_tap_unit);
+                       if (sc->sc_tap_unit >= 0)
+                               ksnprintf(ifs->ascii + len, sizeof(ifs->ascii) - len,
+                                   "\tBacked by tap%d\n", sc->sc_tap_unit);
                }
                break;
        }