From 309baf307c285c7bde907febd19fc6dd4ac36cf2 Mon Sep 17 00:00:00 2001 From: henning Date: Mon, 5 May 2014 10:00:45 +0000 Subject: [PATCH] remove dead code: calling ether_attach which sets if_type to IFT_ETHER, just to set it to IFT_L2VLAN right afterwards, just to set if_type to the parent's if_type which can be anything as long as it is IFT_ETHER at config time doesn't make any sense and has zero effect. stop fiddling with if_type alltogether. also remove a question in a comment that has been answered by the last 14 years. from Marrakesh airport, ok reyk --- sys/net/if_vlan.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 2c9bb1284cf..3a58d4d6e3f 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.103 2014/04/22 11:43:07 henning Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.104 2014/05/05 10:00:45 henning Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -151,8 +151,6 @@ vlan_clone_create(struct if_clone *ifc, int unit) IFQ_SET_READY(&ifp->if_snd); if_attach(ifp); ether_ifattach(ifp); - /* Now undo some of the damage... */ - ifp->if_type = IFT_L2VLAN; ifp->if_hdrlen = EVL_ENCAPLEN; ifp->if_output = vlan_output; @@ -373,12 +371,6 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, u_int16_t tag) vlan_set_promisc(&ifv->ifv_if); } - /* - * Inherit the if_type from the parent. This allows us to - * participate in bridges of that type. - */ - ifv->ifv_if.if_type = p->if_type; - /* * Inherit baudrate from the parent. An SNMP agent would use this * information. @@ -392,9 +384,6 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, u_int16_t tag) * * If the card cannot handle hardware tagging, it cannot * possibly compute the correct checksums for tagged packets. - * - * This brings up another possibility, do cards exist which - * have all of these capabilities but cannot utilize them together? */ if (p->if_capabilities & IFCAP_VLAN_HWTAGGING) ifv->ifv_if.if_capabilities = p->if_capabilities & -- 2.20.1