svn commit: r316527 - head/sys/netinet
Ryan Stone
rstone at FreeBSD.org
Wed Apr 5 16:57:14 UTC 2017
Author: rstone
Date: Wed Apr 5 16:57:13 2017
New Revision: 316527
URL: https://svnweb.freebsd.org/changeset/base/316527
Log:
Revert the optimization from r304436
r304436 attempted to optimize the handling of incoming UDP packet by only
making an expensive call to in_broadcast() if the mbuf was marked as an
broadcast packet. Unfortunately, this cannot work in the case of point-to-
point L2 protocols like PPP, which have no notion of "broadcast". The
optimization has been disabled for several months now with no progress
towards fixing it, so it needs to go.
Modified:
head/sys/netinet/udp_usrreq.c
Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c Wed Apr 5 16:56:04 2017 (r316526)
+++ head/sys/netinet/udp_usrreq.c Wed Apr 5 16:57:13 2017 (r316527)
@@ -123,12 +123,6 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac
&VNET_NAME(udp_blackhole), 0,
"Do not send port unreachables for refused connects");
-static VNET_DEFINE(int, udp_require_l2_bcast) = 0;
-#define V_udp_require_l2_bcast VNET(udp_require_l2_bcast)
-SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW,
- &VNET_NAME(udp_require_l2_bcast), 0,
- "Only treat packets sent to an L2 broadcast address as broadcast packets");
-
u_long udp_sendspace = 9216; /* really max datagram size */
SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW,
&udp_sendspace, 0, "Maximum outgoing UDP datagram size");
@@ -529,8 +523,7 @@ udp_input(struct mbuf **mp, int *offp, i
pcbinfo = udp_get_inpcbinfo(proto);
if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
- ((!V_udp_require_l2_bcast || m->m_flags & M_BCAST) &&
- in_broadcast(ip->ip_dst, ifp))) {
+ in_broadcast(ip->ip_dst, ifp)) {
struct inpcb *last;
struct inpcbhead *pcblist;
struct ip_moptions *imo;
More information about the svn-src-all
mailing list