| 1121 | } |
| 1122 | |
| 1123 | static void |
| 1124 | tcp_rl_ifnet_link(void *arg __unused, struct ifnet *ifp, int link_state) |
| 1125 | { |
| 1126 | int error; |
| 1127 | struct tcp_rate_set *rs; |
| 1128 | |
| 1129 | if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || |
| 1130 | (link_state != LINK_STATE_UP)) { |
| 1131 | /* |
| 1132 | * We only care on an interface going up that is rate-limit |
| 1133 | * capable. |
| 1134 | */ |
| 1135 | return; |
| 1136 | } |
| 1137 | mtx_lock(&rs_mtx); |
| 1138 | CK_LIST_FOREACH(rs, &int_rs, next) { |
| 1139 | if ((rs->rs_ifp == ifp) && |
| 1140 | (rs->rs_if_dunit == ifp->if_dunit)) { |
| 1141 | /* We already have initialized this guy */ |
| 1142 | mtx_unlock(&rs_mtx); |
| 1143 | return; |
| 1144 | } |
| 1145 | } |
| 1146 | mtx_unlock(&rs_mtx); |
| 1147 | rt_setup_new_rs(ifp, &error); |
| 1148 | } |
| 1149 | |
| 1150 | static void |
| 1151 | tcp_rl_ifnet_departure(void *arg __unused, struct ifnet *ifp) |
nothing calls this directly
no test coverage detected