svn commit: r296881 - in head: contrib/bsnmp/snmp_mibII sys/netinet

Shawn Webb shawn.webb at hardenedbsd.org
Wed Mar 16 15:05:15 UTC 2016


On Tue, Mar 15, 2016 at 12:15:10AM +0000, Gleb Smirnoff wrote:
> Author: glebius
> Date: Tue Mar 15 00:15:10 2016
> New Revision: 296881
> URL: https://svnweb.freebsd.org/changeset/base/296881
> 
> Log:
>   Redo r294869. The array of counters for TCP states doesn't belong to
>   struct tcpstat, because the structure can be zeroed out by netstat(1) -z,
>   and of course running connection counts shouldn't be touched.
>   
>   Place running connection counts into separate array, and provide
>   separate read-only sysctl oid for it.
> 
> Modified:
>   head/contrib/bsnmp/snmp_mibII/mibII_tcp.c
>   head/sys/netinet/tcp_input.c
>   head/sys/netinet/tcp_subr.c
>   head/sys/netinet/tcp_syncache.c
>   head/sys/netinet/tcp_timewait.c
>   head/sys/netinet/tcp_usrreq.c
>   head/sys/netinet/tcp_var.h
> 

[snip]

> 
> Modified: head/sys/netinet/tcp_input.c
> ==============================================================================
> --- head/sys/netinet/tcp_input.c	Tue Mar 15 00:05:00 2016	(r296880)
> +++ head/sys/netinet/tcp_input.c	Tue Mar 15 00:15:10 2016	(r296881)
> @@ -235,16 +235,39 @@ VNET_DEFINE(struct inpcbhead, tcb);
>  VNET_DEFINE(struct inpcbinfo, tcbinfo);
>  
>  /*
> - * TCP statistics are stored in an "array" of counter(9)s.
> + * TCP statistics are stored in an array of counter(9)s, which size matches
> + * size of struct tcpstat.  TCP running connection count is a regular array.
>   */
>  VNET_PCPUSTAT_DEFINE(struct tcpstat, tcpstat);
> -VNET_PCPUSTAT_SYSINIT(tcpstat);
>  SYSCTL_VNET_PCPUSTAT(_net_inet_tcp, TCPCTL_STATS, stats, struct tcpstat,
>      tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)");
> +VNET_DEFINE(counter_u64_t, tcps_states[TCP_NSTATES]);
> +SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD |
> +    CTLFLAG_VNET, &VNET_NAME(tcps_states), TCP_NSTATES,
> +    "TCP connection counts by TCP state");

This breaks the build on amd64:

/usr/src/sys/netinet/tcp_input.c:245:1: error: static_assert failed "compile-time assertion failed"
SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/sys/sysctl.h:657:2: note: expanded from macro 'SYSCTL_COUNTER_U64_ARRAY'
        CTASSERT((((access) & CTLTYPE) == 0 ||                          \
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/sys/sys/systm.h:103:21: note: expanded from macro 'CTASSERT'
#define CTASSERT(x)     _Static_assert(x, "compile-time assertion failed")
                        ^              ~
-- 
Shawn Webb
HardenedBSD

GPG Key ID:          0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20160316/35d5ea54/attachment.sig>


More information about the svn-src-head mailing list