From 4ab164bfd343511317777ff71a22bc226cbdd815 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 6 Aug 2010 15:15:26 +0000 Subject: Adjust the interface type in the link layer socket address for vlan(4) interfaces to be a vlan (IFT_L2VLAN) rather than an Ethernet interface (IFT_ETHER). The code already fixed if_type in the ifnet causing some places to report the interface as a vlan (e.g. arp -a output) and other places to report the interface as Ethernet (getifaddrs(3)). Now they should all report IFT_L2VLAN. Reviewed by: brooks MFC after: 1 month --- sys/net/if_vlan.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/net/if_vlan.c') diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 9235bd3..63fc026 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -688,6 +688,8 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) struct ifvlan *ifv; struct ifnet *ifp; struct ifnet *p; + struct ifaddr *ifa; + struct sockaddr_dl *sdl; struct vlanreq vlr; static const u_char eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ @@ -786,6 +788,9 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) ifp->if_baudrate = 0; ifp->if_type = IFT_L2VLAN; ifp->if_hdrlen = ETHER_VLAN_ENCAP_LEN; + ifa = ifp->if_addr; + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + sdl->sdl_type = IFT_L2VLAN; if (ethertag) { error = vlan_config(ifv, p, tag); -- cgit v1.1