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
This commit is contained in:
John Baldwin 2010-08-06 15:09:21 +00:00
parent ea235a1449
commit d99d8e2e38
5 changed files with 9 additions and 2 deletions

View File

@ -843,6 +843,7 @@ check_llbcast(struct mibif *ifp)
case IFT_ETHER:
case IFT_FDDI:
case IFT_ISO88025:
case IFI_L2VLAN:
if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL &&
(rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL)
rcv->flags |= MIBRCVADDR_BCAST;

View File

@ -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)));

View File

@ -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 {

View File

@ -437,6 +437,7 @@ set(argc, argv)
switch (sdl->sdl_type) {
case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023:
case IFT_ISO88024: case IFT_ISO88025:
case IFT_L2VLAN: case IFT_BRIDGE:
goto overwrite;
}
}

View File

@ -148,6 +148,7 @@ SetInterfaceID(u_char *ifid, int userandom)
switch(sdl->sdl_type) {
case IFT_ETHER:
case IFT_FDDI:
case IFT_L2VLAN:
/* XXX need more cases? */
break;
default: