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.
This commit is contained in:
parent
2a5a630e5b
commit
e52698ef42
@ -123,12 +123,6 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blackhole, CTLFLAG_VNET | CTLFLAG_RW,
|
||||
&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, int proto)
|
||||
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user