File tree Expand file tree Collapse file tree 7 files changed +21
-38
lines changed
Expand file tree Collapse file tree 7 files changed +21
-38
lines changed Original file line number Diff line number Diff line change @@ -4467,19 +4467,6 @@ if_getmtu(const if_t ifp)
44674467 return (ifp -> if_mtu );
44684468}
44694469
4470- int
4471- if_getmtu_family (const if_t ifp , int family )
4472- {
4473- struct domain * dp ;
4474-
4475- SLIST_FOREACH (dp , & domains , dom_next ) {
4476- if (dp -> dom_family == family && dp -> dom_ifmtu != NULL )
4477- return (dp -> dom_ifmtu (ifp ));
4478- }
4479-
4480- return (ifp -> if_mtu );
4481- }
4482-
44834470void
44844471if_setppromisc (if_t ifp , bool ppromisc )
44854472{
Original file line number Diff line number Diff line change @@ -620,7 +620,6 @@ const uint8_t *if_getbroadcastaddr(const if_t ifp);
620620void if_setbroadcastaddr (if_t ifp , const uint8_t * );
621621int if_setmtu (if_t ifp , int mtu );
622622int if_getmtu (const if_t ifp );
623- int if_getmtu_family (const if_t ifp , int family );
624623void if_notifymtu (if_t ifp );
625624void if_setppromisc (const if_t ifp , bool ppromisc );
626625int if_setflagbits (if_t ifp , int set , int clear );
Original file line number Diff line number Diff line change @@ -508,26 +508,29 @@ rt_getifa_fib(struct rt_addrinfo *info, u_int fibnum)
508508 return (error );
509509}
510510
511+ /*
512+ * Try to update rt_mtu for all routes using this interface. Unfortunately the
513+ * only way to do this is to traverse all routing tables in all fibs.
514+ */
511515void
512516rt_updatemtu (struct ifnet * ifp )
513517{
514518 struct rib_head * rnh ;
515- int mtu ;
516- int i , j ;
519+ #ifdef INET6
520+ uint32_t in6mtu ;
517521
518- /*
519- * Try to update rt_mtu for all routes using this interface
520- * Unfortunately the only way to do this is to traverse all
521- * routing tables in all fibs/domains.
522- */
523- for (i = 1 ; i <= AF_MAX ; i ++ ) {
524- mtu = if_getmtu_family (ifp , i );
525- for (j = 0 ; j < rt_numfibs ; j ++ ) {
526- rnh = rt_tables_get_rnh (j , i );
527- if (rnh == NULL )
528- continue ;
529- nhops_update_ifmtu (rnh , ifp , mtu );
530- }
522+ in6mtu = in6_ifmtu (ifp );
523+ #endif
524+
525+ for (u_int j = 0 ; j < rt_numfibs ; j ++ ) {
526+ #ifdef INET
527+ rnh = rt_tables_get_rnh (j , AF_INET );
528+ nhops_update_ifmtu (rnh , ifp , ifp -> if_mtu );
529+ #endif
530+ #ifdef INET6
531+ rnh = rt_tables_get_rnh (j , AF_INET6 );
532+ nhops_update_ifmtu (rnh , ifp , in6mtu );
533+ #endif
531534 }
532535}
533536
Original file line number Diff line number Diff line change @@ -2612,12 +2612,9 @@ in6_domifattach(struct ifnet *ifp)
26122612 return ext ;
26132613}
26142614
2615- int
2616- in6_domifmtu (struct ifnet * ifp )
2615+ uint32_t
2616+ in6_ifmtu (struct ifnet * ifp )
26172617{
2618- if (ifp -> if_afdata [AF_INET6 ] == NULL )
2619- return ifp -> if_mtu ;
2620-
26212618 return (IN6_LINKMTU (ifp ));
26222619}
26232620
Original file line number Diff line number Diff line change @@ -113,7 +113,6 @@ struct domain inet6domain = {
113113#endif
114114 .dom_ifattach = in6_domifattach ,
115115 .dom_ifdetach = in6_domifdetach ,
116- .dom_ifmtu = in6_domifmtu ,
117116 .dom_nprotosw = 14 ,
118117 .dom_protosw = {
119118 & tcp6_protosw ,
Original file line number Diff line number Diff line change @@ -869,7 +869,7 @@ int in6if_do_dad(struct ifnet *);
869869void in6_savemkludge (struct in6_ifaddr * );
870870void * in6_domifattach (struct ifnet * );
871871void in6_domifdetach (struct ifnet * , void * );
872- int in6_domifmtu (struct ifnet * );
872+ uint32_t in6_ifmtu (struct ifnet * );
873873struct rib_head * in6_inithead (uint32_t fibnum );
874874void in6_detachhead (struct rib_head * rh );
875875int in6_if2idlen (struct ifnet * );
Original file line number Diff line number Diff line change @@ -58,8 +58,6 @@ struct domain {
5858 (struct rib_head * );
5959 void * (* dom_ifattach )(struct ifnet * );
6060 void (* dom_ifdetach )(struct ifnet * , void * );
61- int (* dom_ifmtu )(struct ifnet * );
62- /* af-dependent data on ifnet */
6361 struct protosw * dom_protosw [];
6462};
6563
You can’t perform that action at this time.
0 commit comments