--- /usr/src/sys/netgraph/ng_ether.c	2010-01-19 04:34:00.000000000 +0800
+++ /usr/src/sys/netgraph/ng_ether.new	2010-11-20 18:26:55.000000000 +0800
@@ -652,6 +652,20 @@
 		    ETHER_ADDR_LEN);
 	}
 
+	/*
+	 * If underlying interface can not do VLAN tag insertion itself
+	 * then attach a packet tag that holds it.
+	 */
+	if ((m->m_flags & M_VLANTAG) &&
+	    (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) {
+		m = ether_vlanencap(m, m->m_pkthdr.ether_vtag);
+		if (m == NULL) {
+			ifp->if_oerrors++;
+			return (ENOBUFS);
+		}
+		m->m_flags &= ~M_VLANTAG;
+	}
+
 	/* Send it on its way */
 	return ether_output_frame(ifp, m);
 }
