summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-08-06 15:09:21 +0000
committerjhb <jhb@FreeBSD.org>2010-08-06 15:09:21 +0000
commit7909344bdf3f86ce88f5a00d727704861218adc9 (patch)
tree11983ee2e4b7413b7f213d4bf31d6ee03d26fe01 /sbin/ifconfig
parent1e529a8eb9b20ba8d3270b4f13b348620eaa00a1 (diff)
downloadFreeBSD-src-7909344bdf3f86ce88f5a00d727704861218adc9.zip
FreeBSD-src-7909344bdf3f86ce88f5a00d727704861218adc9.tar.gz
Ethernet vlan(4) interfaces have valid Ethernet link layer addresses but
use a different interface type (IFT_L2VLAN vs IFT_ETHER). Treat IFT_L2VLAN interfaces like IFT_ETHER interfaces when handling link layer addresses. Reviewed by: syrinx (bsnmpd) MFC after: 1 week
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/af_link.c4
-rw-r--r--sbin/ifconfig/ifconfig.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c
index f77515e..4a4b661 100644
--- a/sbin/ifconfig/af_link.c
+++ b/sbin/ifconfig/af_link.c
@@ -58,7 +58,9 @@ link_status(int s __unused, const struct ifaddrs *ifa)
struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr;
if (sdl != NULL && sdl->sdl_alen > 0) {
- if (sdl->sdl_type == IFT_ETHER &&
+ if ((sdl->sdl_type == IFT_ETHER ||
+ sdl->sdl_type == IFT_L2VLAN ||
+ sdl->sdl_type == IFT_BRIDGE) &&
sdl->sdl_alen == ETHER_ADDR_LEN)
printf("\tether %s\n",
ether_ntoa((struct ether_addr *)LLADDR(sdl)));
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index aa96175..8abe82b 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -319,7 +319,9 @@ main(int argc, char *argv[])
/* special case for "ether" address family */
if (!strcmp(afp->af_name, "ether")) {
if (sdl == NULL ||
- sdl->sdl_type != IFT_ETHER ||
+ (sdl->sdl_type != IFT_ETHER &&
+ sdl->sdl_type != IFT_L2VLAN &&
+ sdl->sdl_type != IFT_BRIDGE) ||
sdl->sdl_alen != ETHER_ADDR_LEN)
continue;
} else {
OpenPOWER on IntegriCloud