diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -446,7 +446,7 @@ void *, u_int); struct mbuf *ether_vlanencap_proto(struct mbuf *, uint16_t, uint16_t); bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, - struct ifnet *p, struct ether_8021q_tag *); + struct ifnet *p, const struct ether_8021q_tag *); void ether_gen_addr(struct ifnet *ifp, struct ether_addr *hwaddr); static __inline struct mbuf *ether_vlanencap(struct mbuf *m, uint16_t tag) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1400,11 +1400,12 @@ bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, - struct ether_8021q_tag *qtag) + const struct ether_8021q_tag *qtag) { struct m_tag *mtag; int n; uint16_t tag; + uint8_t pcp = qtag->pcp; static const char pad[8]; /* just zeros */ /* @@ -1437,7 +1438,7 @@ * If PCP is set in mbuf, use it */ if ((*mp)->m_flags & M_VLANTAG) { - qtag->pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); + pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); } /* @@ -1451,7 +1452,7 @@ MTAG_8021Q_PCP_OUT, NULL)) != NULL) tag = EVL_MAKETAG(qtag->vid, *(uint8_t *)(mtag + 1), 0); else - tag = EVL_MAKETAG(qtag->vid, qtag->pcp, 0); + tag = EVL_MAKETAG(qtag->vid, pcp, 0); if ((p->if_capenable & IFCAP_VLAN_HWTAGGING) && (qtag->proto == ETHERTYPE_VLAN)) { (*mp)->m_pkthdr.ether_vtag = tag;