diff options
author | bz <bz@FreeBSD.org> | 2012-03-27 15:14:29 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2012-03-27 15:14:29 +0000 |
commit | f89de17b6917a4f64a7873a2f40dce483734bccb (patch) | |
tree | 3c7dbc4bd9c231404dcb271f3d533db5800d3694 /sys/netinet/udp_usrreq.c | |
parent | 4cab4cc0c449d52fbd34b538334bc118c4203465 (diff) | |
download | FreeBSD-src-f89de17b6917a4f64a7873a2f40dce483734bccb.zip FreeBSD-src-f89de17b6917a4f64a7873a2f40dce483734bccb.tar.gz |
Export the udp_cksum sysctl for upcoming SCTP work. Rather than always,
SCTP will only do IPv4 UDP checksum calculation as defined by the host
policy. When tunneling SCTP always calculates the inner checksum already
so not doing the outer UDP can save cycles.
While here virtualize the variable.
Requested by: tuexen
MFC after: 2 weeks
Diffstat (limited to 'sys/netinet/udp_usrreq.c')
-rw-r--r-- | sys/netinet/udp_usrreq.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 701bc35..2056baf 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -105,9 +105,9 @@ __FBSDID("$FreeBSD$"); * packets that would otherwise be discarded due to bad checksums, and may * cause problems (especially for NFS data blocks). */ -static int udp_cksum = 1; -SYSCTL_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW, &udp_cksum, - 0, "compute udp checksum"); +VNET_DEFINE(int, udp_cksum) = 1; +SYSCTL_VNET_INT(_net_inet_udp, UDPCTL_CHECKSUM, checksum, CTLFLAG_RW, + &VNET_NAME(udp_cksum), 0, "compute udp checksum"); int udp_log_in_vain = 0; SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW, @@ -1212,7 +1212,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, /* * Set up checksum and output datagram. */ - if (udp_cksum) { + if (V_udp_cksum) { if (inp->inp_flags & INP_ONESBCAST) faddr.s_addr = INADDR_BROADCAST; ui->ui_sum = in_pseudo(ui->ui_src.s_addr, faddr.s_addr, |