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
This commit is contained in:
John Baldwin 2020-10-06 18:02:33 +00:00
parent 56fb710f1b
commit 9aed26b906

View File

@ -1137,7 +1137,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state)
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 *ifp,
/*
* 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;