summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2022-02-16 01:45:32 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2022-02-16 01:45:32 +0000
commitbd09251a79fe1297eb83031c0572b364971d3566 (patch)
treeea95f1e6dc7f76d5f094100592fe8f377d8c9fac
parent4e7f3665cdf5668336d6f70cd91bc530836c8930 (diff)
fill in support for rx prio handling.
-rw-r--r--sys/net/if_vxlan.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c
index 37f09d81eb0..3631a59d166 100644
--- a/sys/net/if_vxlan.c
+++ b/sys/net/if_vxlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vxlan.c,v 1.84 2022/02/16 01:25:45 dlg Exp $ */
+/* $OpenBSD: if_vxlan.c,v 1.85 2022/02/16 01:45:31 dlg Exp $ */
/*
* Copyright (c) 2021 David Gwynne <dlg@openbsd.org>
@@ -623,6 +623,8 @@ vxlan_input(void *arg, struct mbuf *m, struct ip *ip, struct ip6_hdr *ip6,
in_port_t port;
struct vxlan_softc *sc = NULL;
struct ifnet *ifp;
+ int rxhprio;
+ uint8_t tos;
if (m->m_pkthdr.len < vhlen)
goto drop;
@@ -630,11 +632,15 @@ vxlan_input(void *arg, struct mbuf *m, struct ip *ip, struct ip6_hdr *ip6,
uh = uhp;
port = uh->uh_sport;
- if (ip != NULL)
+ if (ip != NULL) {
addr.in4 = ip->ip_src;
+ tos = ip->ip_tos;
+ }
#ifdef INET6
- else
+ else {
addr.in6 = ip6->ip6_src;
+ tos = bemtoh32(&ip6->ip6_flow) >> 20;
+ }
#endif
if (m->m_len < vhlen) {
@@ -698,7 +704,18 @@ vxlan_input(void *arg, struct mbuf *m, struct ip *ip, struct ip6_hdr *ip6,
(struct ether_addr *)eh->ether_shost);
}
- /* XXX prio */
+ rxhprio = sc->sc_rxhprio;
+ switch (rxhprio) {
+ case IF_HDRPRIO_PACKET:
+ /* nop */
+ break;
+ case IF_HDRPRIO_OUTER:
+ m->m_pkthdr.pf.prio = IFQ_TOS2PRIO(tos);
+ break;
+ default:
+ m->m_pkthdr.pf.prio = rxhprio;
+ break; \
+ } \
if_vinput(ifp, m);
rele: