* Track route changes for TX rate limiting. */
| 3663 | * Track route changes for TX rate limiting. |
| 3664 | */ |
| 3665 | void |
| 3666 | in_pcboutput_eagain(struct inpcb *inp) |
| 3667 | { |
| 3668 | bool did_upgrade; |
| 3669 | |
| 3670 | if (inp == NULL) |
| 3671 | return; |
| 3672 | |
| 3673 | if (inp->inp_snd_tag == NULL) |
| 3674 | return; |
| 3675 | |
| 3676 | if (!INP_WLOCKED(inp)) { |
| 3677 | /* |
| 3678 | * NOTE: If the write locking fails, we need to bail |
| 3679 | * out and use the non-ratelimited ring for the |
| 3680 | * transmit until there is a new chance to get the |
| 3681 | * write lock. |
| 3682 | */ |
| 3683 | if (!INP_TRY_UPGRADE(inp)) |
| 3684 | return; |
| 3685 | did_upgrade = 1; |
| 3686 | } else { |
| 3687 | did_upgrade = 0; |
| 3688 | } |
| 3689 | |
| 3690 | /* detach rate limiting */ |
| 3691 | in_pcbdetach_txrtlmt(inp); |
| 3692 | |
| 3693 | /* make sure new mbuf send tag allocation is made */ |
| 3694 | inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED; |
| 3695 | |
| 3696 | if (did_upgrade) |
| 3697 | INP_DOWNGRADE(inp); |
| 3698 | } |
| 3699 | |
| 3700 | #ifdef INET |
| 3701 | static void |
no test coverage detected