Index: head/sys/netinet/tcp_ratelimit.c =================================================================== --- head/sys/netinet/tcp_ratelimit.c +++ head/sys/netinet/tcp_ratelimit.c @@ -1220,6 +1220,8 @@ { const struct tcp_hwrate_limit_table *rte; + INP_WLOCK_ASSERT(tp->t_inpcb); + if (tp->t_inpcb->inp_snd_tag == NULL) { /* * We are setting up a rate for the first time. @@ -1250,6 +1252,7 @@ *error = EINVAL; rte = NULL; } + tp->t_pacing_rate = rte->rate; *error = 0; return (rte); } @@ -1264,6 +1267,8 @@ int is_indirect = 0; int err; + INP_WLOCK_ASSERT(tp->t_inpcb); + if ((tp->t_inpcb->inp_snd_tag == NULL) || (crte == NULL)) { /* Wrong interface */ @@ -1330,6 +1335,7 @@ } if (error) *error = 0; + tp->t_pacing_rate = nrte->rate; return (nrte); } @@ -1340,6 +1346,9 @@ struct tcp_rate_set *rs; uint64_t pre; + INP_WLOCK_ASSERT(tp->t_inpcb); + + tp->t_pacing_rate = -1; crs = crte->ptbl; /* * Now we must break the const Index: head/sys/netinet/tcp_subr.c =================================================================== --- head/sys/netinet/tcp_subr.c +++ head/sys/netinet/tcp_subr.c @@ -1783,6 +1783,7 @@ /* Initialize the per-TCPCB log data. */ tcp_log_tcpcbinit(tp); #endif + tp->t_pacing_rate = -1; if (tp->t_fb->tfb_tcp_fb_init) { if ((*tp->t_fb->tfb_tcp_fb_init)(tp)) { refcount_release(&tp->t_fb->tfb_refcnt); Index: head/sys/netinet/tcp_var.h =================================================================== --- head/sys/netinet/tcp_var.h +++ head/sys/netinet/tcp_var.h @@ -246,6 +246,7 @@ int t_dupacks; /* consecutive dup acks recd */ int t_lognum; /* Number of log entries */ int t_loglimit; /* Maximum number of log entries */ + int64_t t_pacing_rate; /* bytes / sec, -1 => unlimited */ struct tcp_log_stailq t_logs; /* Log buffer */ struct tcp_log_id_node *t_lin; struct tcp_log_id_bucket *t_lib;