diff options
| author | 2019-04-28 22:15:57 +0000 | |
|---|---|---|
| committer | 2019-04-28 22:15:57 +0000 | |
| commit | 96c4247ccbf78c38f00780e28567a99a63d7bf42 (patch) | |
| tree | 79d5e244376310b8fa18e3191a7ee50f295e17de /sys/netinet/ip_output.c | |
| parent | Support multiple occurances of the same argument. Use this for a new (diff) | |
| download | wireguard-openbsd-96c4247ccbf78c38f00780e28567a99a63d7bf42.tar.xz wireguard-openbsd-96c4247ccbf78c38f00780e28567a99a63d7bf42.zip | |
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.c | 12 |
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 */ |
