summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2019-04-28 22:15:59 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2019-04-28 22:15:59 +0000
commit18fddbc0ffa78e2efee3b7db27bfe5c5f8c46545 (patch)
tree62f22d322f0aa70d58dfb4b7448324845a27e611 /sys/netinet/ip_output.c
parent33d544b49816a3e9c53b23a441cbbb44ca3e7104 (diff)
Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.
This redefines the ifp <-> bridge relationship. No lock can be currently used across the multiples contexts where the bridge has tentacles to protect a pointer, use an interface index. Tested by various, ok dlg@, visa@
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 95c94ee4b94..b69cebc5d0b 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.353 2019/01/18 20:46:03 claudio Exp $ */
+/* $OpenBSD: ip_output.c,v 1.354 2019/04/28 22:15:58 mpi Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -460,7 +460,7 @@ sendit:
if (ntohs(ip->ip_len) <= mtu) {
ip->ip_sum = 0;
if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
- (ifp->if_bridgeport == NULL))
+ (ifp->if_bridgeidx == 0))
m->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
else {
ipstat_inc(ips_outswcsum);
@@ -719,7 +719,7 @@ ip_fragment(struct mbuf *m, struct ifnet *ifp, u_long mtu)
mhip->ip_sum = 0;
if ((ifp != NULL) &&
(ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
- (ifp->if_bridgeport == NULL))
+ (ifp->if_bridgeidx == 0))
m->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
else {
ipstat_inc(ips_outswcsum);
@@ -740,7 +740,7 @@ ip_fragment(struct mbuf *m, struct ifnet *ifp, u_long mtu)
ip->ip_sum = 0;
if ((ifp != NULL) &&
(ifp->if_capabilities & IFCAP_CSUM_IPv4) &&
- (ifp->if_bridgeport == NULL))
+ (ifp->if_bridgeidx == 0))
m->m_pkthdr.csum_flags |= M_IPV4_CSUM_OUT;
else {
ipstat_inc(ips_outswcsum);
@@ -1806,14 +1806,14 @@ in_proto_cksum_out(struct mbuf *m, struct ifnet *ifp)
if (m->m_pkthdr.csum_flags & M_TCP_CSUM_OUT) {
if (!ifp || !(ifp->if_capabilities & IFCAP_CSUM_TCPv4) ||
- ip->ip_hl != 5 || ifp->if_bridgeport != NULL) {
+ ip->ip_hl != 5 || ifp->if_bridgeidx != 0) {
tcpstat_inc(tcps_outswcsum);
in_delayed_cksum(m);
m->m_pkthdr.csum_flags &= ~M_TCP_CSUM_OUT; /* Clear */
}
} else if (m->m_pkthdr.csum_flags & M_UDP_CSUM_OUT) {
if (!ifp || !(ifp->if_capabilities & IFCAP_CSUM_UDPv4) ||
- ip->ip_hl != 5 || ifp->if_bridgeport != NULL) {
+ ip->ip_hl != 5 || ifp->if_bridgeidx != 0) {
udpstat_inc(udps_outswcsum);
in_delayed_cksum(m);
m->m_pkthdr.csum_flags &= ~M_UDP_CSUM_OUT; /* Clear */