summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-02-20 00:38:15 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-02-20 00:38:15 +0000
commitfe3c801fb730a410f2e1d2fd8bc986036e7182ab (patch)
tree93321e72d20998183bb77ff781e4454fa1d38d21 /sys
parent107523d02ba87d2ad9005b89cef569a7846bece8 (diff)
don't store the BOS flag as part of the remote label, add it at tx time.
this is to prepare for flow aware transport for FAT from RFC 6391
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_mpw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/net/if_mpw.c b/sys/net/if_mpw.c
index dacbb8cd763..82b5829b01a 100644
--- a/sys/net/if_mpw.c
+++ b/sys/net/if_mpw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mpw.c,v 1.42 2019/02/20 00:31:17 dlg Exp $ */
+/* $OpenBSD: if_mpw.c,v 1.43 2019/02/20 00:38:14 dlg Exp $ */
/*
* Copyright (c) 2015 Rafael Zalamena <rzalamena@openbsd.org>
@@ -264,7 +264,6 @@ mpw_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
sc->sc_cword = ISSET(imr.imr_flags, IMR_FLAG_CONTROLWORD);
sc->sc_type = imr.imr_type;
sc->sc_rshim.shim_label = imr.imr_rshim.shim_label;
- sc->sc_rshim.shim_label |= MPLS_BOS_MASK;
memset(&sc->sc_nexthop, 0, sizeof(sc->sc_nexthop));
sin_nexthop = (struct sockaddr_in *) &sc->sc_nexthop;
@@ -421,6 +420,7 @@ mpw_start(struct ifnet *ifp)
.smpls_len = sizeof(smpls),
.smpls_family = AF_MPLS,
};
+ uint32_t bos;
if (!ISSET(ifp->if_flags, IFF_RUNNING) ||
sc->sc_rshim.shim_label == 0 ||
@@ -467,13 +467,15 @@ mpw_start(struct ifnet *ifp)
memset(shim, 0, sizeof(*shim));
}
+ bos = MPLS_BOS_MASK;
+
m0 = m_prepend(m0, sizeof(*shim), M_NOWAIT);
if (m0 == NULL)
continue;
shim = mtod(m0, struct shim_hdr *);
shim->shim_label = htonl(mpls_defttl) & MPLS_TTL_MASK;
- shim->shim_label |= sc->sc_rshim.shim_label;
+ shim->shim_label |= sc->sc_rshim.shim_label | bos;
m0->m_pkthdr.ph_rtableid = ifp->if_rdomain;