MFC 1.252: Prevent dereferencing NULL route pointer when trying to update

the route MTU.
This commit is contained in:
andre 2006-01-31 16:01:38 +00:00
parent c625a74834
commit b80f61dff3

View File

@ -788,7 +788,8 @@ passout:
* them, there is no way for one to update all its
* routes when the MTU is changed.
*/
if ((ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST)) &&
if (ro != NULL &&
(ro->ro_rt->rt_flags & (RTF_UP | RTF_HOST)) &&
(ro->ro_rt->rt_rmx.rmx_mtu > ifp->if_mtu)) {
ro->ro_rt->rt_rmx.rmx_mtu = ifp->if_mtu;
}