| 769 | } |
| 770 | |
| 771 | void |
| 772 | nhops_update_ifmtu(struct rib_head *rh, struct ifnet *ifp, uint32_t mtu) |
| 773 | { |
| 774 | struct nh_control *ctl; |
| 775 | struct nhop_priv *nh_priv; |
| 776 | struct nhop_object *nh; |
| 777 | |
| 778 | ctl = rh->nh_control; |
| 779 | |
| 780 | NHOPS_WLOCK(ctl); |
| 781 | CHT_SLIST_FOREACH(&ctl->nh_head, nhops, nh_priv) { |
| 782 | nh = nh_priv->nh; |
| 783 | if (nh->nh_ifp == ifp) { |
| 784 | if ((nh_priv->rt_flags & RTF_FIXEDMTU) == 0 || |
| 785 | nh->nh_mtu > mtu) { |
| 786 | /* Update MTU directly */ |
| 787 | nh->nh_mtu = mtu; |
| 788 | } |
| 789 | } |
| 790 | } CHT_SLIST_FOREACH_END; |
| 791 | NHOPS_WUNLOCK(ctl); |
| 792 | |
| 793 | } |
| 794 | |
| 795 | /* |
| 796 | * Dumps a single entry to sysctl buffer. |