Consider the following situation:
1. A packet comes in that is to be forwarded 2. The destination of the packet is rewritten by some firewall code 3. The next link's MTU is too small 4. The packet has the DF bit set Then the current code is such that instead of setting the next link's MTU in the ICMP error, ip_next_mtu() is called and a guess is sent as to which MTU is supposed to be tried next. This is because in this case ip_forward() is called with srcrt set to 1. In that case the ia pointer remains NULL but it is needed to get the MTU of the interface the packet is to be sent out from. Thus, we always set ia to the outgoing interface. MFC after: 2 weeks
This commit is contained in:
parent
b21a1da537
commit
d23d475fb4
@ -1268,7 +1268,8 @@ ip_forward(struct mbuf *m, int srcrt)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!srcrt && (ia = ip_rtaddr(ip->ip_dst)) == NULL) {
|
||||
ia = ip_rtaddr(ip->ip_dst);
|
||||
if (!srcrt && ia == NULL) {
|
||||
icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user