MFC 1.312: In ip_forward() compute MTU always if it hasn't been done before.

This commit is contained in:
andre 2006-01-31 16:17:22 +00:00
parent d5bfca13df
commit f527d7aaff

View File

@ -1925,20 +1925,20 @@ ip_forward(struct mbuf *m, int srcrt)
#endif
ipstat.ips_cantfrag++;
break;
} else
#endif /*IPSEC || FAST_IPSEC*/
/*
* When doing source routing 'ia' can be NULL. Fall back
* to the minimum guaranteed routeable packet size and use
* the same hack as IPSEC to setup a dummyifp for icmp.
*/
if (ia == NULL)
mtu = IP_MSS;
else
mtu = ia->ia_ifp->if_mtu;
#if defined(IPSEC) || defined(FAST_IPSEC)
}
}
#endif /*IPSEC || FAST_IPSEC*/
/*
* If the MTU wasn't set before use the interface mtu or
* fall back to the next smaller mtu step compared to the
* current packet size.
*/
if (mtu == 0) {
if (ia != NULL)
mtu = ia->ia_ifp->if_mtu;
else
mtu = ip_next_mtu(ip->ip_len, 0);
}
ipstat.ips_cantfrag++;
break;