Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Oct 2020 18:02:33 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r366492 - head/sys/netinet
Message-ID:  <202010061802.096I2XiW078537@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Oct  6 18:02:33 2020
New Revision: 366492
URL: https://svnweb.freebsd.org/changeset/base/366492

Log:
  Check if_capenable, not if_capabilities when enabling rate limiting.
  
  if_capabilities is a read-only mask of supported capabilities.
  if_capenable is a mask under administrative control via ifconfig(8).
  
  Reviewed by:	gallatin
  Sponsored by:	Netflix
  Differential Revision:	https://reviews.freebsd.org/D26690

Modified:
  head/sys/netinet/tcp_ratelimit.c

Modified: head/sys/netinet/tcp_ratelimit.c
==============================================================================
--- head/sys/netinet/tcp_ratelimit.c	Tue Oct  6 17:58:56 2020	(r366491)
+++ head/sys/netinet/tcp_ratelimit.c	Tue Oct  6 18:02:33 2020	(r366492)
@@ -1137,7 +1137,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *if
 	int error;
 	struct tcp_rate_set *rs;
 
-	if (((ifp->if_capabilities & IFCAP_TXRTLMT) == 0) ||
+	if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) ||
 	    (link_state != LINK_STATE_UP)) {
 		/*
 		 * We only care on an interface going up that is rate-limit
@@ -1224,7 +1224,7 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *if
 		/*
 		 * We are setting up a rate for the first time.
 		 */
-		if ((ifp->if_capabilities & IFCAP_TXRTLMT) == 0) {
+		if ((ifp->if_capenable & IFCAP_TXRTLMT) == 0) {
 			/* Not supported by the egress */
 			if (error)
 				*error = ENODEV;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010061802.096I2XiW078537>