svn commit: r310207 - stable/11/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Sun Dec 18 11:54:11 UTC 2016


Author: tuexen
Date: Sun Dec 18 11:54:10 2016
New Revision: 310207
URL: https://svnweb.freebsd.org/changeset/base/310207

Log:
  MFC r305810:
  
  Ensure that the IPPROTO_TCP level socket options
  * TCP_KEEPINIT
  * TCP_KEEPINTVL
  * TCP_KEEPIDLE
  * TCP_KEEPCNT
  always always report the values currently used when getsockopt()
  is used. This wasn't the case when the sysctl-inherited default
  values where used.
  Ensure that the IPPROTO_TCP level socket option TCP_INFO has the
  TCPI_OPT_ECN flag set in the tcpi_options field when ECN support
  has been negotiated successfully.
  
  Sponsored by:	Netflix, Inc.

Modified:
  stable/11/sys/netinet/tcp_usrreq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netinet/tcp_usrreq.c
==============================================================================
--- stable/11/sys/netinet/tcp_usrreq.c	Sun Dec 18 11:15:31 2016	(r310206)
+++ stable/11/sys/netinet/tcp_usrreq.c	Sun Dec 18 11:54:10 2016	(r310207)
@@ -1346,6 +1346,8 @@ tcp_fill_info(struct tcpcb *tp, struct t
 		ti->tcpi_snd_wscale = tp->snd_scale;
 		ti->tcpi_rcv_wscale = tp->rcv_scale;
 	}
+	if (tp->t_flags & TF_ECN_PERMIT)
+		ti->tcpi_options |= TCPI_OPT_ECN;
 
 	ti->tcpi_rto = tp->t_rxtcur * tick;
 	ti->tcpi_last_data_recv = (long)(ticks - (int)tp->t_rcvtime) * tick;
@@ -1815,16 +1817,16 @@ unlock_and_done:
 		case TCP_KEEPCNT:
 			switch (sopt->sopt_name) {
 			case TCP_KEEPIDLE:
-				ui = tp->t_keepidle / hz;
+				ui = TP_KEEPIDLE(tp) / hz;
 				break;
 			case TCP_KEEPINTVL:
-				ui = tp->t_keepintvl / hz;
+				ui = TP_KEEPINTVL(tp) / hz;
 				break;
 			case TCP_KEEPINIT:
-				ui = tp->t_keepinit / hz;
+				ui = TP_KEEPINIT(tp) / hz;
 				break;
 			case TCP_KEEPCNT:
-				ui = tp->t_keepcnt;
+				ui = TP_KEEPCNT(tp);
 				break;
 			}
 			INP_WUNLOCK(inp);


More information about the svn-src-all mailing list