Module Name: src Committed By: maxv Date: Mon Jan 15 11:16:04 UTC 2018
Modified Files: src/sys/net/agr: if_agr.c Log Message: Mmh, fix a weird mistake: the guy who added #if NVLAN > 0 forgot to actually include vlan.h, so the branches are never compiled. They don't compile, by the way, so fix that too, by reproducing the vlan input path of ether_input(). To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/net/agr/if_agr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/agr/if_agr.c diff -u src/sys/net/agr/if_agr.c:1.43 src/sys/net/agr/if_agr.c:1.44 --- src/sys/net/agr/if_agr.c:1.43 Wed Dec 6 07:40:16 2017 +++ src/sys/net/agr/if_agr.c Mon Jan 15 11:16:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_agr.c,v 1.43 2017/12/06 07:40:16 ozaki-r Exp $ */ +/* $NetBSD: if_agr.c,v 1.44 2018/01/15 11:16:04 maxv Exp $ */ /*- * Copyright (c)2005 YAMAMOTO Takashi, @@ -27,12 +27,14 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.43 2017/12/06 07:40:16 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1.44 2018/01/15 11:16:04 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" #endif +#include "vlan.h" + #include <sys/param.h> #include <sys/callout.h> #include <sys/malloc.h> @@ -53,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_agr.c,v 1 #include <net/if_dl.h> #include <net/if_types.h> #include <net/if_ether.h> +#include <net/if_vlanvar.h> #if defined(INET) #include <netinet/in.h> @@ -146,11 +149,9 @@ agrdetach(void) void agr_input(struct ifnet *ifp_port, struct mbuf *m) { + struct ethercom *ec = (struct ethercom *)ifp_port; struct agr_port *port; struct ifnet *ifp; -#if NVLAN > 0 - struct m_tag *mtag; -#endif port = ifp_port->if_agrprivate; KASSERT(port); @@ -163,26 +164,19 @@ agr_input(struct ifnet *ifp_port, struct m_set_rcvif(m, ifp); -#define DNH_DEBUG + /* + * If VLANs are configured on the interface, check to + * see if the device performed the decapsulation and + * provided us with the tag. + */ + if (ec->ec_nvlans && vlan_has_tag(m)) { #if NVLAN > 0 - /* got a vlan packet? */ - if ((mtag = m_tag_find(m, PACKET_TAG_VLAN, NULL)) != NULL) { -#ifdef DNH_DEBUG - printf("%s: vlan tag %d attached\n", - ifp->if_xname, - htole16((*(u_int *)(mtag + 1)) & 0xffff)); - printf("%s: vlan input\n", ifp->if_xname); -#endif vlan_input(ifp, m); - return; -#ifdef DNH_DEBUG - } else { - struct ethercom *ec = (void *)ifp; - printf("%s: no vlan tag attached, ec_nvlans=%d\n", - ifp->if_xname, ec->ec_nvlans); +#else + m_freem(m); #endif + return; } -#endif if_percpuq_enqueue(ifp->if_percpuq, m); }