summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-08-06 15:15:26 +0000
committerjhb <jhb@FreeBSD.org>2010-08-06 15:15:26 +0000
commit4ab164bfd343511317777ff71a22bc226cbdd815 (patch)
treea7e5bb439e2daa843ee620c51fc2357c07a4314a /sys/net/if_vlan.c
parent7909344bdf3f86ce88f5a00d727704861218adc9 (diff)
downloadFreeBSD-src-4ab164bfd343511317777ff71a22bc226cbdd815.zip
FreeBSD-src-4ab164bfd343511317777ff71a22bc226cbdd815.tar.gz
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
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c5
1 files changed, 5 insertions, 0 deletions
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);
OpenPOWER on IntegriCloud